diff options
author | simonmorris@chromium.org <simonmorris@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-09 21:03:35 +0000 |
---|---|---|
committer | simonmorris@chromium.org <simonmorris@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-09 21:03:35 +0000 |
commit | 12b072b875917f3491956473d843748bbf8fecfa (patch) | |
tree | b0a8c71209fd5d1beb15be032682546517b1c2ea /remoting/host/setup/oauth_helper.h | |
parent | 72cfbe44c6d2be44aa3b47a4c5a07cf81cb65e77 (diff) | |
download | chromium_src-12b072b875917f3491956473d843748bbf8fecfa.zip chromium_src-12b072b875917f3491956473d843748bbf8fecfa.tar.gz chromium_src-12b072b875917f3491956473d843748bbf8fecfa.tar.bz2 |
[Chromoting] Add a class that gets an OAuth authorization code, on Windows.
BUG=153453
Review URL: https://chromiumcodereview.appspot.com/11072008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@160925 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/setup/oauth_helper.h')
-rw-r--r-- | remoting/host/setup/oauth_helper.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/remoting/host/setup/oauth_helper.h b/remoting/host/setup/oauth_helper.h new file mode 100644 index 0000000..a762c23 --- /dev/null +++ b/remoting/host/setup/oauth_helper.h @@ -0,0 +1,32 @@ +// 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. + +#ifndef REMOTING_HOST_SETUP_OAUTH_HELPER_H +#define REMOTING_HOST_SETUP_OAUTH_HELPER_H + +#include <string> + +namespace remoting { + +// Gets the OAuth scope of the host's refresh token. +std::string GetOauthScope(); + +// Gets a URL at which the OAuth dance starts. +std::string GetOauthStartUrl(); + +// Gets a redirect URL for the OAuth dance. +std::string GetOauthRedirectUrl(); + +// Returns the OAuth authorization code embedded in a URL, or the empty string +// if there is no such code. +// To get an OAuth authorization code, (i) start a browser, (ii) navigate it +// to |GetOauthStartUrl()|, (iii) ask the user to sign on to their account, +// and grant the requested permissions, (iv) monitor the URLs that the browser +// shows, passing each one to |GetOauthCodeInUrl()|, until that function returns +// a non-empty string. That string is the authorization code. +std::string GetOauthCodeInUrl(const std::string& url); + +} // namespace remoting + +#endif // REMOTING_HOST_SETUP_OAUTH_HELPER_H |