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

Unified Diff: remoting/protocol/me2me_host_authenticator_factory.cc

Issue 12326090: Third Party authentication protocol. (Closed) Base URL: http://git.chromium.org/chromium/src.git@host_key_pair
Patch Set: Add the missing new files Created 7 years, 10 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
Index: remoting/protocol/me2me_host_authenticator_factory.cc
diff --git a/remoting/protocol/me2me_host_authenticator_factory.cc b/remoting/protocol/me2me_host_authenticator_factory.cc
index 754ace6e7cba84a5e045b85ec0b1043161633afd..b9251c9831e1f1b2cbf6fcf7cbe81ef16cd7c641 100644
--- a/remoting/protocol/me2me_host_authenticator_factory.cc
+++ b/remoting/protocol/me2me_host_authenticator_factory.cc
@@ -59,10 +59,18 @@ class RejectingAuthenticator : public Authenticator {
Me2MeHostAuthenticatorFactory::Me2MeHostAuthenticatorFactory(
const std::string& local_cert,
scoped_ptr<KeyPair> key_pair,
- const SharedSecretHash& shared_secret_hash)
+ const SharedSecretHash& shared_secret_hash,
+ const std::string& third_party_token_url,
+ const std::string& third_party_token_validation_url,
+ ThirdPartyAuthenticator::TokenValidatorFactory*
+ third_party_token_validator_factory)
: local_cert_(local_cert),
key_pair_(key_pair.Pass()),
- shared_secret_hash_(shared_secret_hash) {
+ shared_secret_hash_(shared_secret_hash),
+ third_party_token_url_(third_party_token_url),
+ third_party_token_validation_url_(third_party_token_validation_url),
+ third_party_token_validator_factory_(third_party_token_validator_factory)
+{
}
Me2MeHostAuthenticatorFactory::~Me2MeHostAuthenticatorFactory() {
@@ -89,9 +97,20 @@ scoped_ptr<Authenticator> Me2MeHostAuthenticatorFactory::CreateAuthenticator(
return scoped_ptr<Authenticator>(new RejectingAuthenticator());
}
- return NegotiatingAuthenticator::CreateForHost(
- local_cert_, key_pair_->Copy(), shared_secret_hash_.value,
- shared_secret_hash_.hash_function);
+ if (third_party_token_url_.empty() ||
+ third_party_token_validation_url_.empty() ||
+ third_party_token_validator_factory_ == NULL) {
+ return NegotiatingAuthenticator::CreateForHostSharedSecret(
+ local_cert_, key_pair_->Copy(), shared_secret_hash_.value,
+ shared_secret_hash_.hash_function);
+ } else {
+ std::string third_party_token_scope =
+ "client:" + remote_jid + " host:" + local_jid;
+ return NegotiatingAuthenticator::CreateForHostThirdPartyAuth(
+ local_cert_, key_pair_->Copy(), third_party_token_url_,
+ third_party_token_validation_url_, third_party_token_scope,
+ third_party_token_validator_factory_);
+ }
}
} // namespace protocol

Powered by Google App Engine
This is Rietveld 408576698