[ Web Proxy ]
URL:
Viewing: https://firebase.google.com/docs/reference/js/v8/firebase.auth.TwitterAuthProvider [Back]  [Original]

TwitterAuthProvider | JavaScript SDK  |  Firebase JavaScript API reference Skip to main content
Overview Fundamentals AI Build Run Reference Samples
Firebase [Firebase]
Send feedback Stay organized with collections Save and categorize content based on your preferences.

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

Implementation of AuthProvider.providerId

Inherited from TwitterAuthProvider.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 in firebase.auth.Auth.fetchSignInMethodsForEmail.

Methods

setCustomParameters

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

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

    • token: string

      Twitter access token.

    • secret: string

      Twitter secret.

    Returns OAuthCredential

    The auth provider credential.

Send feedback

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2022-07-27 UTC.

Need to tell us more? [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2022-07-27 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page