chrome.experimental.identity

This API is still being developed. It is only available to developers building from trunk.

chrome.experimental.identity reference

Methods

getAuthToken

chrome.experimental.identity.getAuthToken(object details, function callback)

Gets an OAuth2 access token as specified by the manifest.

Parameters

details ( optional object )
Token options.
interactive ( optional boolean )
Whether to prompt the user to log in or grant scope permissions (if they have not already done so). Default is false.
callback ( function )
Called with an OAuth2 access token as specified by the manifest, or undefined if there was an error.

Callback

The callback parameter should specify a function that looks like this:

function(string token) {...};
token ( optional string )

launchWebAuthFlow

chrome.experimental.identity.launchWebAuthFlow(object details, function callback)

Starts an auth flow at the specified URL.

Parameters

details ( object )
WebAuth flow options.
url ( string )
The URL that initiates the auth flow.
interactive ( optional boolean )
Whether to launch auth flow in interactive mode. Default is false.
width ( optional integer )
Width of the window, if one is shown in interactive mode.
height ( optional integer )
Height of the window, if one is shown in interactive mode.
left ( optional integer )
X coordinate of the window, if one is shown in interactive mode.
top ( optional integer )
Y coordinate of the window, if one is shown in interactive mode.
callback ( function )
Called with the URL redirected back to your application.

Callback

The callback parameter should specify a function that looks like this:

function(string responseUrl) {...};
responseUrl ( optional string )

Sample Apps that use chrome.experimental.identity

  • Appsquare
  • Google Drive Uploader
  • Identity API
  • Step1 – 3rd Party Auth step1