createProviderConfig method

Future<AuthProviderConfig> createProviderConfig(
  1. AuthProviderConfig config
)
inherited

Returns a Future that completes with the newly created AuthProviderConfig when the new provider configuration is created.

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.

Implementation

Future<AuthProviderConfig> createProviderConfig(
  AuthProviderConfig config,
) async {
  if (OIDCAuthProviderConfig.isProviderId(config.providerId)) {
    final response = await _authRequestHandler.createOAuthIdpConfig(
      config as OIDCAuthProviderConfig,
    );
    return OIDCAuthProviderConfig.fromResponse(response);
  } else if (SAMLAuthProviderConfig.isProviderId(config.providerId)) {
    final response = await _authRequestHandler.createInboundSamlConfig(
      config as SAMLAuthProviderConfig,
    );
    return SAMLAuthProviderConfig.fromResponse(response);
  }

  throw FirebaseAuthAdminException(AuthClientErrorCode.invalidProviderId);
}