diff options
author | sergeyu <sergeyu@chromium.org> | 2016-03-09 18:59:14 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-10 03:01:00 +0000 |
commit | 1acf67baf01cd3f0cf072c3136a0929bb953073c (patch) | |
tree | b8124e8c04983ec09c921f87ad8852c6b1b4155a /remoting/protocol/authenticator.h | |
parent | 3a80f8993c32aefb757e8e2ff5e1fcff3a9dbc32 (diff) | |
download | chromium_src-1acf67baf01cd3f0cf072c3136a0929bb953073c.zip chromium_src-1acf67baf01cd3f0cf072c3136a0929bb953073c.tar.gz chromium_src-1acf67baf01cd3f0cf072c3136a0929bb953073c.tar.bz2 |
Replace ThirdPartyClientAuthenticator::TokenFetcher with a callback.
Callbacks are already used to fetch PIN. It doesn't make sense to
use a different style to fetch third-party tokens.
Review URL: https://codereview.chromium.org/1774113005
Cr-Commit-Position: refs/heads/master@{#380316}
Diffstat (limited to 'remoting/protocol/authenticator.h')
-rw-r--r-- | remoting/protocol/authenticator.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/remoting/protocol/authenticator.h b/remoting/protocol/authenticator.h index febf38c..8b89111 100644 --- a/remoting/protocol/authenticator.h +++ b/remoting/protocol/authenticator.h @@ -25,6 +25,27 @@ typedef base::Callback<void( bool pairing_supported, const SecretFetchedCallback& secret_fetched_callback)> FetchSecretCallback; +// Callback passed to |FetchTokenCallback|, and called once the client +// authentication finishes. |token| is an opaque string that should be sent +// directly to the host. |shared_secret| should be used by the client to +// create a V2Authenticator. In case of failure, the callback is called with +// an empty |token| and |shared_secret|. +typedef base::Callback<void(const std::string& token, + const std::string& shared_secret)> + ThirdPartyTokenFetchedCallback; + +// Fetches a third party token from |token_url|. |host_public_key| is sent to +// the server so it can later authenticate the host. |scope| is a string with a +// space-separated list of attributes for this connection (e.g. +// "hostjid:abc@example.com/123 clientjid:def@example.org/456". +// |token_fetched_callback| is called when the client authentication ends, on +// the same thread on which FetchThirdPartyTokenCallback was originally called. +typedef base::Callback<void( + const std::string& token_url, + const std::string& scope, + const ThirdPartyTokenFetchedCallback& token_fetched_callback)> + FetchThirdPartyTokenCallback; + // Authenticator is an abstract interface for authentication protocol // implementations. Different implementations of this interface may be used on // each side of the connection depending of type of the auth protocol. Client |