1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // The <code>chrome.experimental.identity</code> API.
6 namespace experimental.identity {
8 [inline_doc] dictionary ExperimentalTokenDetails {
9 // Whether to prompt the user to log in or grant scope permissions (if they
10 // have not already done so). Default is false.
14 [inline_doc] dictionary ExperimentalWebAuthFlowDetails {
15 // The URL that initiates the auth flow.
18 // Whether to launch auth flow in interactive mode. Default is false.
21 // Width of the window, if one is shown in interactive mode.
24 // Height of the window, if one is shown in interactive mode.
27 // X coordinate of the window, if one is shown in interactive mode.
30 // Y coordinate of the window, if one is shown in interactive mode.
34 callback GetAuthTokenCallback = void (optional DOMString token);
35 callback InvalidateAuthTokenCallback = void ();
36 callback LaunchWebAuthFlowCallback = void (optional DOMString responseUrl);
39 // Gets an OAuth2 access token as specified by the manifest.
41 // |details| : Token options.
42 // |callback| : Called with an OAuth2 access token as specified by the
43 // manifest, or undefined if there was an error.
44 static void getAuthToken(optional ExperimentalTokenDetails details,
45 GetAuthTokenCallback callback);
47 // Starts an auth flow at the specified URL.
49 // |details| : WebAuth flow options.
50 // |callback| : Called with the URL redirected back to your application.
51 static void launchWebAuthFlow(ExperimentalWebAuthFlowDetails details,
52 LaunchWebAuthFlowCallback callback);