OAuthProvider

class OAuthProvider : FederatedAuthProvider


Represents the login authentication provider for a generic OAuth2 provider. Use this class to obtain AuthCredentials.

Summary

Nested types

Class used to create instances of OAuthProvider.

Builder class to initialize AuthCredential's.

Public functions

java-static AuthCredential
@InlineMe(replacement = "DefaultOAuthCredential.createDefaultOAuthCredential(providerId, idToken, accessToken)", imports = "com.google.firebase.auth.DefaultOAuthCredential")
getCredential(providerId: String, idToken: String, accessToken: String)

This function is deprecated.

use newCredentialBuilder instead

String?

Returns the provider ID with which this OAuthProvider is associated.

java-static OAuthProvider.Builder
newBuilder(providerId: String)

Returns a OAuthProvider.Builder used to construct a OAuthProvider instantiated with the given providerId.

java-static OAuthProvider.Builder
newBuilder(providerId: String, firebaseAuth: FirebaseAuth)

Returns a OAuthProvider.Builder used to construct a OAuthProvider instantiated with the given providerId.

java-static OAuthProvider.CredentialBuilder

Creates an CredentialBuilder for the specified provider ID.

Public functions

getCredential

@InlineMe(replacement = "DefaultOAuthCredential.createDefaultOAuthCredential(providerId, idToken, accessToken)", imports = "com.google.firebase.auth.DefaultOAuthCredential")
java-static fun getCredential(providerId: String, idToken: String, accessToken: String): AuthCredential

Returns a new instance of AuthCredential that wraps a login token. Used when calling signInWithCredential or linkWithCredential.

Parameters
accessToken: String

a valid Facebook Login access token, obtained from the Facebook Login SDK

getProviderId

fun getProviderId(): String?

Returns the provider ID with which this OAuthProvider is associated.

newBuilder

java-static fun newBuilder(providerId: String): OAuthProvider.Builder

Returns a OAuthProvider.Builder used to construct a OAuthProvider instantiated with the given providerId.

newBuilder

java-static fun newBuilder(providerId: String, firebaseAuth: FirebaseAuth): OAuthProvider.Builder

Returns a OAuthProvider.Builder used to construct a OAuthProvider instantiated with the given providerId. Uses the specified FirebaseAuth instance.

newCredentialBuilder

java-static fun newCredentialBuilder(providerId: String): OAuthProvider.CredentialBuilder

Creates an CredentialBuilder for the specified provider ID.

Throws
java.lang.IllegalArgumentException

if providerId is null or empty