Implements
Index
Properties
Methods
Properties
providerId
Static PROVIDER_ID
Static TWITTER_SIGN_IN_METHOD
This corresponds to the sign-in method identifier as returned in firebase.auth.Auth.fetchSignInMethodsForEmail.
Methods
setCustomParameters
-
Sets the OAuth custom parameters to pass in a Twitter OAuth request for popup and redirect sign-in operations. Valid parameters include 'lang'. Reserved required OAuth 1.0 parameters such as 'oauth_consumer_key', 'oauth_token', 'oauth_signature', etc are not allowed and will be ignored.
Parameters
-
customOAuthParameters: Object
The custom OAuth parameters to pass in the OAuth request.
Returns AuthProvider
The provider instance itself.
-
Static credential
-
Parameters
-
token: string
Twitter access token.
-
secret: string
Twitter secret.
Returns OAuthCredential
The auth provider credential.
-
Twitter auth provider.
// Using a redirect. firebase.auth().getRedirectResult().then(function(result) { if (result.credential) { // For accessing the Twitter API. var token = result.credential.accessToken; var secret = result.credential.secret; } var user = result.user; }); // Start a sign in process for an unauthenticated user. var provider = new firebase.auth.TwitterAuthProvider(); firebase.auth().signInWithRedirect(provider);
// Using a popup. var provider = new firebase.auth.TwitterAuthProvider(); firebase.auth().signInWithPopup(provider).then(function(result) { // For accessing the Twitter API. var token = result.credential.accessToken; var secret = result.credential.secret; // The signed-in user info. var user = result.user; });
firebase.auth.Auth.onAuthStateChanged to receive sign in state changes.