| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 [DartPackage="mojo_services", JavaPackage="org.chromium.mojo.authentication"] | 5 [DartPackage="mojo_services", JavaPackage="org.chromium.mojo.authentication"] |
| 6 module authentication; | 6 module authentication; |
| 7 | 7 |
| 8 // Interface to handle user identity and authentication tokens. | 8 // Interface to handle user identity and authentication tokens. |
| 9 // TODO(qsr): This API only handles google accounts at this time. It will need | 9 // TODO(qsr): This API only handles google accounts at this time. It will need |
| 10 // to be extended to allow generic account manager on the platform. | 10 // to be extended to allow generic account manager on the platform. |
| 11 interface AuthenticationService { | 11 interface AuthenticationService { |
| 12 // Requests a Google account to use. In case of success, error will be null. | 12 // Requests a Google account to use. In case of success, error will be null. |
| 13 // In case of error, username will be null and error will contain a | 13 // In case of error, username will be null and error will contain a |
| 14 // description of the error. If |return_last_selected| is true and the client | 14 // description of the error. If |return_last_selected| is true and the client |
| 15 // application already selected an account, the same account will be returned | 15 // application already selected an account, the same account will be returned |
| 16 // without user intervention. | 16 // without user intervention. |
| 17 SelectAccount(bool return_last_selected) => (string? username, string? error); | 17 SelectAccount(bool return_last_selected) => (string? username, string? error); |
| 18 | 18 |
| 19 // Requests an oauth2 token for the given Google account with the given | 19 // Requests an oauth2 token for the given Google account with the given |
| 20 // scopes. In case of error, username will be null and error will contain a | 20 // scopes. In case of error, username will be null and error will contain a |
| 21 // description of the error. | 21 // description of the error. |
| 22 GetOAuth2Token(string username, array<string> scopes) => | 22 GetOAuth2Token(string username, array<string> scopes) => |
| 23 (string? token, string? error); | 23 (string? token, string? error); |
| 24 | 24 |
| 25 // Requests to clear a previously acquired token. This should be called when a | 25 // Requests to clear a previously acquired token. This should be called when a |
| 26 // token is refused by a server component before requesting a new token to | 26 // token is refused by a server component before requesting a new token to |
| 27 // clear the token from any cache. | 27 // clear the token from any cache. |
| 28 ClearOAuth2Token(string token); | 28 ClearOAuth2Token(string token); |
| 29 }; | 29 }; |
| OLD | NEW |