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 statechanges.

Implements

Index

Properties

providerId

providerId:string

Implementation ofAuthProvider.providerId

Inherited fromTwitterAuthProvider.providerId

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 infirebase.auth.Auth.fetchSignInMethodsForEmail.

Methods

setCustomParameters

  • setCustomParameters(customOAuthParametersObject):AuthProvider
  • Inherited fromTwitterAuthProvider.setCustomParameters

    Sets the OAuth custom parameters to pass in a Twitter OAuth request for popupand 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 passin the OAuth request.

    ReturnsAuthProvider

    The provider instance itself.

Static credential

  • credential(tokenstring, secretstring):OAuthCredential
  • Parameters

    • token:string

      Twitter access token.

    • secret:string

      Twitter secret.

    ReturnsOAuthCredential

    The auth provider credential.

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 2022-07-27 UTC.