OAuthProvider
@available(iOS 13, tvOS 13, macOS 10.15, watchOS 7, *)
@objc(FIROAuthProvider)
open class OAuthProvider : NSObject, FederatedAuthProviderUtility class for constructing OAuth Sign In credentials.
-
Undocumented
Declaration
Swift
@objc public static let id: String -
Array used to configure the OAuth scopes.
Declaration
Swift
@objc open var scopes: [String]? -
Dictionary used to configure the OAuth custom parameters.
Declaration
Swift
@objc open var customParameters: [String : String]? -
The provider ID indicating the specific OAuth provider this OAuthProvider instance represents.
Declaration
Swift
@objc public let providerID: String -
An instance of OAuthProvider corresponding to the given provider ID.
Declaration
Swift
public class func provider(providerID: AuthProviderID) -> OAuthProviderParameters
providerIDThe provider ID of the IDP for which this auth provider instance will be configured.
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
public class func provider(providerID: AuthProviderID, auth: Auth) -> OAuthProviderParameters
providerIDThe provider ID of the IDP for which this auth provider instance will be configured.
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
public convenience init(providerID: AuthProviderID, auth: Auth = Auth.auth())Parameters
providerIDThe provider ID of the IDP for which this auth provider instance will be configured.
authThe auth instance to be associated with the OAuthProvider instance.
-
Creates an
AuthCredentialfor the OAuth 2 provider identified by provider ID, ID token, and access token.Declaration
Swift
public static func credential(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, if available.
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 using an ID token.Declaration
Swift
public static func credential(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, ID token, raw nonce, and access token.Declaration
Swift
public static func credential(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, if available.
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
open func getCredentialWith(_ 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 main thread 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(iOS 13, tvOS 13, macOS 10.15, watchOS 8, *) @objc(getCredentialWithUIDelegate:completion:) @MainActor open func credential(with uiDelegate: AuthUIDelegate?) async throws -> AuthCredentialParameters
uiDelegateAn optional UI delegate used to present the mobile web flow.
completionHandlerOptionally; a block which is invoked asynchronously on the main thread when the mobile web flow is completed.
-
Creates an
AuthCredentialfor the Sign in with Apple OAuth 2 provider identified by ID token, raw nonce, and full name.This method is specific to the Sign in with Apple OAuth 2 provider as this provider requires the full name to be passed explicitly.Declaration
Swift
@objc(appleCredentialWithIDToken:rawNonce:fullName:) public static func appleCredential(withIDToken idToken: String, rawNonce: String?, fullName: PersonNameComponents?) -> OAuthCredentialParameters
idTokenThe IDToken associated with the Sign in with Apple Auth credential being created.
rawNonceThe raw nonce associated with the Sign in with Apple Auth credential being created.
fullNameThe full name associated with the Sign in with Apple Auth credential being created.
Return Value
An AuthCredential.