You're viewing the legacy docs. They are deprecated as of May 18, 2016.
These docs are for version 2.4.2 and below of the Javascript SDK. Go to our current docs, or see our Web migration guide.

Version 2.4.2Changelog

Firebase.authWithOAuthToken()

Authenticates a Firebase client using an OAuth access token. The session will live until its configured expiration time in the Login & Auth tab of your App Dashboard, or when you explicitly end the session by calling unauth().

All Firebase references to the same database share the same authentication status, so if you call new Firebase("https://.firebaseio.com/") twice and call any authentication method on one of them, they will both be authenticated.

This method accepts either a single string argument for OAuth credentials (such as an OAuth 2.0 bearer access token) or an object (such as a set of OAuth 1.0a credentials). Logging in with Facebook, GitHub, and Google with an OAuth token requires just a string access token:

// Authenticate with Facebook using an existing OAuth 2.0 access token
svar ref = new Firebase("https://<YOUR-FIREBASE-APP>.firebaseio.com");
ref.authWithOAuthToken("facebook", "<ACCESS-TOKEN>", function(error, authData) {
  if (error) {
    console.log("Login Failed!", error);
  } else {
    console.log("Authenticated successfully with payload:", authData);
  }
});

On the other hand, logging in with Twitter requires an object containing several OAuth credentials:

// Authenticate with Twitter using an existing OAuth 1.0a credential set
var ref = new Firebase("https://<YOUR-FIREBASE-APP>.firebaseio.com");
ref.authWithOAuthToken("twitter", {
  "user_id": "<USER-ID>",
  "oauth_token": "<ACCESS-TOKEN>",
  "oauth_token_secret": "<ACCESS-TOKEN-SECRET>"
}, function(error, authData) {
  if (error) {
    console.log("Login Failed!", error);
  } else {
    console.log("Authenticated successfully with payload:", authData);
  }
});