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

Unified Diff: google_apis/gaia/gaia_auth_fetcher.h

Issue 13599003: revoke unused OAuth2 tokens on signout and re-signin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « google_apis/gaia/gaia_auth_consumer.h ('k') | google_apis/gaia/gaia_auth_fetcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gaia/gaia_auth_fetcher.h
diff --git a/google_apis/gaia/gaia_auth_fetcher.h b/google_apis/gaia/gaia_auth_fetcher.h
index 06ff3295271bc01306c36991f9ea03876a721479..bcd111675fd253cf06b74bb03a8ce555f85fb911 100644
--- a/google_apis/gaia/gaia_auth_fetcher.h
+++ b/google_apis/gaia/gaia_auth_fetcher.h
@@ -100,6 +100,12 @@ class GaiaAuthFetcher : public net::URLFetcherDelegate {
// called on the consumer on the original thread.
void StartLsoForOAuthLoginTokenExchange(const std::string& auth_token);
+ // Start a request to revoke |auth_token|.
+ //
+ // Either OnRevokeOAuth2TokenSuccess or OnRevokeOAuth2TokenSuccess will be
+ // called on the consumer on the original thread.
+ void StartRevokeOAuth2Token(const std::string& auth_token);
+
// Start a request to exchange the cookies of a signed-in user session
// for an OAuthLogin-scoped oauth2 token. In the case of a session with
// multiple accounts signed in, |session_index| indicate the which of accounts
@@ -216,6 +222,8 @@ class GaiaAuthFetcher : public net::URLFetcherDelegate {
static const char kClientLoginToOAuth2BodyFormat[];
// The format of the POST body to get OAuth2 token pair from auth code.
static const char kOAuth2CodeToTokenPairBodyFormat[];
+ // The format of the POST body to revoke an OAuth2 token.
+ static const char kOAuth2RevokeTokenBodyFormat[];
// The format of the POST body for GetUserInfo.
static const char kGetUserInfoFormat[];
// The format of the POST body for MergeSession.
@@ -273,6 +281,10 @@ class GaiaAuthFetcher : public net::URLFetcherDelegate {
const net::URLRequestStatus& status,
int response_code);
+ void OnOAuth2RevokeTokenFetched(const std::string& data,
+ const net::URLRequestStatus& status,
+ int response_code);
+
void OnGetUserInfoFetched(const std::string& data,
const net::URLRequestStatus& status,
int response_code);
@@ -338,6 +350,8 @@ class GaiaAuthFetcher : public net::URLFetcherDelegate {
static std::string MakeGetAuthCodeBody();
// Given auth code, create body to get OAuth2 token pair.
static std::string MakeGetTokenPairBody(const std::string& auth_code);
+ // Given an OAuth2 token, create body to revoke the token.
+ std::string MakeRevokeTokenBody(const std::string& auth_token);
// Supply the lsid returned from ClientLogin in order to fetch
// user information.
static std::string MakeGetUserInfoBody(const std::string& lsid);
@@ -392,6 +406,7 @@ class GaiaAuthFetcher : public net::URLFetcherDelegate {
const GURL client_login_gurl_;
const GURL issue_auth_token_gurl_;
const GURL oauth2_token_gurl_;
+ const GURL oauth2_revoke_gurl_;
const GURL get_user_info_gurl_;
const GURL merge_session_gurl_;
const GURL uberauth_token_gurl_;
« no previous file with comments | « google_apis/gaia/gaia_auth_consumer.h ('k') | google_apis/gaia/gaia_auth_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698