FirebaseAuth Framework Reference Stay organized with collections Save and categorize content based on your preferences.
OAuthProvider
@available(iOS13,tvOS13,macOS10.15,watchOS7,*)@objc(FIROAuthProvider)openclassOAuthProvider:NSObject,FederatedAuthProviderUtility class for constructing OAuth Sign In credentials.
Undocumented
Declaration
Swift
@objcpublicstaticletid:StringArray 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:StringAn instance of OAuthProvider corresponding to the given provider ID.
Declaration
Swift
publicclassfuncprovider(providerID:AuthProviderID)->OAuthProviderParameters
providerIDThe 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)->OAuthProviderParameters
providerIDThe provider ID of the IDP for which this auth provider instance will beconfigured.
authThe auth instance to be associated with the OAuthProvider instance.
Return Value
An instance of OAuthProvider corresponding to the specified provider ID.
Initializes an
OAuthProvider.Declaration
Swift
publicconvenienceinit(providerID:AuthProviderID,auth:Auth=Auth.auth())Parameters
providerIDThe provider ID of the IDP for which this auth provider instance willbe configured.
authThe auth instance to be associated with the OAuthProvider instance.
Creates an
AuthCredentialfor the OAuth 2 provider identified by provider ID, IDtoken, and access token.Declaration
Swift
publicstaticfunccredential(providerID:AuthProviderID,idToken:String,accessToken:String?=nil)->OAuthCredentialParameters
providerIDThe provider ID associated with the Auth credential being created.
idTokenThe IDToken associated with the Auth credential being created.
accessTokenThe 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 an
AuthCredentialfor the OAuth 2 provider identified by provider ID usingan ID token.Declaration
Swift
publicstaticfunccredential(providerID:AuthProviderID,accessToken:String)->OAuthCredentialParameters
providerIDThe provider ID associated with the Auth credential being created.
accessTokenThe access token associated with the Auth credential be created
Return Value
An AuthCredential.
Creates an
AuthCredentialfor 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)->OAuthCredentialParameters
providerIDThe provider ID associated with the Auth credential being created.
idTokenThe IDToken associated with the Auth credential being created.
rawNonceThe raw nonce associated with the Auth credential being created.
accessTokenThe 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
uiDelegateAn optional UI delegate used to present the mobile web flow.
completionOptionally; 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->AuthCredentialParameters
uiDelegateAn optional UI delegate used to present the mobile web flow.
completionHandlerOptionally; a block which is invokedasynchronously on the main thread when the mobile web flow iscompleted.
Creates an
AuthCredentialfor 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?)->OAuthCredentialParameters
idTokenThe IDToken associated with the Sign in with Apple Auth credential beingcreated.
rawNonceThe raw nonce associated with the Sign in with Apple Auth credentialbeing created.
fullNameThe 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.