Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: chrome/browser/managed_mode/managed_user_token_fetcher.h

Issue 15977002: Add ManagedUserTokenFetcher to fetch scoped-down tokens. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 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.
4
5 #ifndef CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_TOKEN_FETCHER_H_
6 #define CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_TOKEN_FETCHER_H_
7
8 #include <string>
9
10 #include "base/callback_forward.h"
11 #include "base/compiler_specific.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "base/string16.h"
14
15 class GoogleServiceAuthError;
16 class OAuth2TokenService;
17
18 namespace net {
19 class URLRequestContextGetter;
20 }
21
22 // This class fetches an OAuth2 token that is tied to a managed user ID and
23 // downscoped to a special scope for Chrome Sync for managed users.
24 // Fetching the token consists of the following steps:
25 // 1. Get an access token from OAuth2TokenService (either cached or fetched)
Andrew T Wilson (Slow) 2013/05/28 13:10:08 "Get an access token for the custodian from OAuth2
Bernhard Bauer 2013/05/29 11:41:45 Done.
26 // 2. Call the IssueToken API to request the downscoped token; the response
Andrew T Wilson (Slow) 2013/05/28 13:10:08 "Call the IssueToken API to mint a scoped authoriz
Bernhard Bauer 2013/05/29 11:41:45 Done, with the additional explanation that the aut
27 // is an authentication code
28 // 3. Exchange the authentication code for a refresh token and an access
Andrew T Wilson (Slow) 2013/05/28 13:10:08 "Exchange the authentication code for a refresh to
Bernhard Bauer 2013/05/29 11:41:45 Done. I didn't use the term "playpen" though, beca
29 // token.
30 class ManagedUserTokenFetcher {
Andrew T Wilson (Slow) 2013/05/28 13:10:08 Might want to change the name to make it clear tha
Bernhard Bauer 2013/05/29 11:41:45 OK, done.
31 public:
32 typedef base::Callback<void(const GoogleServiceAuthError& /* error */,
33 const std::string& /* token */)> TokenCallback;
Andrew T Wilson (Slow) 2013/05/28 13:10:08 token->refresh_token
Bernhard Bauer 2013/05/29 11:41:45 Done.
34
35 static scoped_ptr<ManagedUserTokenFetcher> Create(
36 OAuth2TokenService* oauth2_token_service,
37 net::URLRequestContextGetter* context);
38
39 virtual ~ManagedUserTokenFetcher();
40
41 virtual void Start(const std::string& managed_user_id,
42 const string16& name,
43 const std::string& device_name,
44 const TokenCallback& callback) = 0;
45 };
46
47 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_TOKEN_FETCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698