encode

Encode the provider's secret(s) to a JSON string, or null when there's nothing to store (NoAuthProvider, CompositeAuthProvider).