FirebaseAuth Framework Reference

OAuthProvider

Utility class for constructing OAuth Sign In credentials.

  • Undocumented

    Declaration

    Swift

    @objcpublicstaticletid:String
  • Array used to configure the OAuth scopes.

    Declaration

    Swift

    @objcopenvarscopes:[String]?
  • Dictionary used to configure the OAuth custom parameters.

    Declaration

    Swift

    @objcopenvarcustomParameters:[String:String]?
  • The provider ID indicating the specific OAuth provider this OAuthProvider instance represents.

    Declaration

    Swift

    @objcpublicletproviderID:String
  • An instance of OAuthProvider corresponding to the given provider ID.

    Declaration

    Swift

    publicclassfuncprovider(providerID:AuthProviderID)->OAuthProvider

    Parameters

    providerID

    The provider ID of the IDP for which this auth provider instance will beconfigured.

    Return Value

    An instance of OAuthProvider corresponding to the specified provider ID.

  • An instance of OAuthProvider corresponding to the given provider ID and auth instance.

    Declaration

    Swift

    publicclassfuncprovider(providerID:AuthProviderID,auth:Auth)->OAuthProvider

    Parameters

    providerID

    The provider ID of the IDP for which this auth provider instance will beconfigured.

    auth

    The auth instance to be associated with the OAuthProvider instance.

    Return Value

    An instance of OAuthProvider corresponding to the specified provider ID.

  • Initializes anOAuthProvider.

    Declaration

    Swift

    publicinit(providerID:String,auth:Auth=Auth.auth())

    Parameters

    providerID

    The provider ID of the IDP for which this auth provider instance willbe configured.

    auth

    The auth instance to be associated with the OAuthProvider instance.

  • Initializes anOAuthProvider.

    Declaration

    Swift

    publicconvenienceinit(providerID:AuthProviderID,auth:Auth=Auth.auth())

    Parameters

    providerID

    The provider ID of the IDP for which this auth provider instance willbe configured.

    auth

    The auth instance to be associated with the OAuthProvider instance.

  • Creates anAuthCredential for the OAuth 2 provider identified by provider ID, IDtoken, and access token.

    Declaration

    Swift

    publicstaticfunccredential(providerID:AuthProviderID,idToken:String,accessToken:String?=nil)->OAuthCredential

    Parameters

    providerID

    The provider ID associated with the Auth credential being created.

    idToken

    The IDToken associated with the Auth credential being created.

    accessToken

    The access token associated with the Auth credential be created, ifavailable.

    Return Value

    An AuthCredential for the specified provider ID, ID token and access token.

  • Creates anAuthCredential for the OAuth 2 provider identified by provider ID usingan ID token.

    Declaration

    Swift

    publicstaticfunccredential(providerID:AuthProviderID,accessToken:String)->OAuthCredential

    Parameters

    providerID

    The provider ID associated with the Auth credential being created.

    accessToken

    The access token associated with the Auth credential be created

    Return Value

    An AuthCredential.

  • Creates anAuthCredential for that OAuth 2 provider identified by provider ID, IDtoken, raw nonce, and access token.

    Declaration

    Swift

    publicstaticfunccredential(providerID:AuthProviderID,idToken:String,rawNonce:String,accessToken:String?=nil)->OAuthCredential

    Parameters

    providerID

    The provider ID associated with the Auth credential being created.

    idToken

    The IDToken associated with the Auth credential being created.

    rawNonce

    The raw nonce associated with the Auth credential being created.

    accessToken

    The access token associated with the Auth credential be created, ifavailable.

    Return Value

    An AuthCredential for the specified provider ID, ID token and access token.

  • Used to obtain an auth credential via a mobile web flow.

    This method is available on iOS only.

    Declaration

    Swift

    openfuncgetCredentialWith(_uiDelegate:AuthUIDelegate?,completion:((AuthCredential?,Error?)->Void)?=nil)

    Parameters

    uiDelegate

    An optional UI delegate used to present the mobile web flow.

    completion

    Optionally; a block which is invoked asynchronously on the mainthread when the mobile web flow is completed.

  • Used to obtain an auth credential via a mobile web flow.This method is available on iOS only.

    Declaration

    Swift

    @available(iOS13,tvOS13,macOS10.15,watchOS8,*)@objc(getCredentialWithUIDelegate:completion:)@MainActoropenfunccredential(withuiDelegate:AuthUIDelegate?)asyncthrows->AuthCredential

    Parameters

    uiDelegate

    An optional UI delegate used to present the mobile web flow.

    completionHandler

    Optionally; a block which is invokedasynchronously on the main thread when the mobile web flow iscompleted.

  • Creates anAuthCredential for the Sign in with Apple OAuth 2 provider identified by IDtoken, raw nonce, and full name.This method is specific to the Sign in with Apple OAuth 2provider as this provider requires the full name to be passed explicitly.

    Declaration

    Swift

    @objc(appleCredentialWithIDToken:rawNonce:fullName:)publicstaticfuncappleCredential(withIDTokenidToken:String,rawNonce:String?,fullName:PersonNameComponents?)->OAuthCredential

    Parameters

    idToken

    The IDToken associated with the Sign in with Apple Auth credential beingcreated.

    rawNonce

    The raw nonce associated with the Sign in with Apple Auth credentialbeing created.

    fullName

    The full name associated with the Sign in with Apple Auth credentialbeing created.

    Return Value

    An AuthCredential.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-15 UTC.