getProviderConfig method

Future<AuthProviderConfig> getProviderConfig(
  1. String providerId
)
inherited

Looks up an Auth provider configuration by the provided ID. Returns a promise that resolves with the provider configuration corresponding to the provider ID specified. If the specified ID does not exist, an auth/configuration-not-found error is thrown.

SAML and OIDC provider support requires Google Cloud's Identity Platform (GCIP). To learn more about GCIP, including pricing and features, see the https://cloud.google.com/identity-platform.

  • providerId - The provider ID corresponding to the provider config to return.

Implementation

Future<AuthProviderConfig> getProviderConfig(String providerId) async {
  if (_OIDCConfig.isProviderId(providerId)) {
    final response = await _authRequestHandler.getOAuthIdpConfig(providerId);
    return _OIDCConfig.fromResponse(response);
  } else if (_SAMLConfig.isProviderId(providerId)) {
    final response = await _authRequestHandler.getInboundSamlConfig(
      providerId,
    );
    return _SAMLConfig.fromResponse(response);
  } else {
    throw FirebaseAuthAdminException(AuthClientErrorCode.invalidProviderId);
  }
}