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

Unified Diff: remoting/protocol/me2me_host_authenticator_factory.cc

Issue 12313085: Host-side third party token validation (Closed) Base URL: http://git.chromium.org/chromium/src.git@third_party_auth_protocol
Patch Set: Reviewer comments 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
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 9a04d89742cbf5131e04b80ea1447619af5b5697..a373bf8f6dcf417354914e4e1ae740a134b85086 100644
--- a/remoting/protocol/me2me_host_authenticator_factory.cc
+++ b/remoting/protocol/me2me_host_authenticator_factory.cc
@@ -61,10 +61,13 @@ class RejectingAuthenticator : public Authenticator {
Me2MeHostAuthenticatorFactory::Me2MeHostAuthenticatorFactory(
const std::string& local_cert,
scoped_refptr<RsaKeyPair> key_pair,
- const SharedSecretHash& shared_secret_hash)
+ const SharedSecretHash& shared_secret_hash,
+ scoped_refptr<ThirdPartyHostAuthenticator::TokenValidatorFactory>
+ token_validator_factory)
: local_cert_(local_cert),
key_pair_(key_pair),
- shared_secret_hash_(shared_secret_hash) {
+ shared_secret_hash_(shared_secret_hash),
+ token_validator_factory_(token_validator_factory) {
}
Me2MeHostAuthenticatorFactory::~Me2MeHostAuthenticatorFactory() {
@@ -91,7 +94,12 @@ scoped_ptr<Authenticator> Me2MeHostAuthenticatorFactory::CreateAuthenticator(
return scoped_ptr<Authenticator>(new RejectingAuthenticator());
}
- return NegotiatingAuthenticator::CreateForHost(
+ if (token_validator_factory_->is_enabled()) {
+ return NegotiatingAuthenticator::CreateForHostThirdParty(
+ local_cert_, key_pair_, local_jid, remote_jid,
+ token_validator_factory_.get());
+ }
+ return NegotiatingAuthenticator::CreateForHostSharedSecret(
local_cert_, key_pair_, shared_secret_hash_.value,
shared_secret_hash_.hash_function);
}

Powered by Google App Engine
This is Rietveld 408576698