Twitter auth provider.

example
// 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);
example
// 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;
});
see

firebase.auth.Auth.onAuthStateChanged to receive sign in state changes.

Implements

Index

Properties

providerId

providerId: string

Static PROVIDER_ID

PROVIDER_ID: string

Static TWITTER_SIGN_IN_METHOD

TWITTER_SIGN_IN_METHOD: string

This corresponds to the sign-in method identifier as returned in firebase.auth.Auth.fetchSignInMethodsForEmail.

Methods

setCustomParameters

  • setCustomParameters ( customOAuthParameters Object ) : AuthProvider
  • 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

  • credential ( token string ,  secret string ) : OAuthCredential
  • Parameters

    • token: string

      Twitter access token.

    • secret: string

      Twitter secret.

    Returns OAuthCredential

    The auth provider credential.