// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // The chrome.experimental.identity API. namespace experimental.identity { [inline_doc] dictionary ExperimentalTokenDetails { // Whether to prompt the user to log in or grant scope permissions (if they // have not already done so). Default is false. boolean? interactive; }; [inline_doc] dictionary ExperimentalWebAuthFlowDetails { // The URL that initiates the auth flow. DOMString url; // Whether to launch auth flow in interactive mode. Default is false. boolean? interactive; // Width of the window, if one is shown in interactive mode. long? width; // Height of the window, if one is shown in interactive mode. long? height; // X coordinate of the window, if one is shown in interactive mode. long? left; // Y coordinate of the window, if one is shown in interactive mode. long? top; }; callback GetAuthTokenCallback = void (optional DOMString token); callback InvalidateAuthTokenCallback = void (); callback LaunchWebAuthFlowCallback = void (optional DOMString responseUrl); interface Functions { // Gets an OAuth2 access token as specified by the manifest. // // |details| : Token options. // |callback| : Called with an OAuth2 access token as specified by the // manifest, or undefined if there was an error. static void getAuthToken(optional ExperimentalTokenDetails details, GetAuthTokenCallback callback); // Starts an auth flow at the specified URL. // // |details| : WebAuth flow options. // |callback| : Called with the URL redirected back to your application. static void launchWebAuthFlow(ExperimentalWebAuthFlowDetails details, LaunchWebAuthFlowCallback callback); }; };