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

Side by Side Diff: trunk/src/remoting/host/token_validator_factory_impl.cc

Issue 197463003: Revert 256579 "Allow the content browser client to specify a spe..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/host/token_validator_factory_impl.h" 5 #include "remoting/host/token_validator_factory_impl.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 void TokenValidatorImpl::StartValidateRequest(const std::string& token) { 75 void TokenValidatorImpl::StartValidateRequest(const std::string& token) {
76 post_body_ = "code=" + net::EscapeUrlEncodedData(token, true) + 76 post_body_ = "code=" + net::EscapeUrlEncodedData(token, true) +
77 "&client_id=" + net::EscapeUrlEncodedData( 77 "&client_id=" + net::EscapeUrlEncodedData(
78 key_pair_->GetPublicKey(), true) + 78 key_pair_->GetPublicKey(), true) +
79 "&client_secret=" + net::EscapeUrlEncodedData( 79 "&client_secret=" + net::EscapeUrlEncodedData(
80 key_pair_->SignMessage(token), true) + 80 key_pair_->SignMessage(token), true) +
81 "&grant_type=authorization_code"; 81 "&grant_type=authorization_code";
82 82
83 request_ = request_context_getter_->GetURLRequestContext()->CreateRequest( 83 request_ = request_context_getter_->GetURLRequestContext()->CreateRequest(
84 third_party_auth_config_.token_validation_url, net::DEFAULT_PRIORITY, 84 third_party_auth_config_.token_validation_url, net::DEFAULT_PRIORITY,
85 this, NULL); 85 this);
86 request_->SetExtraRequestHeaderByName( 86 request_->SetExtraRequestHeaderByName(
87 net::HttpRequestHeaders::kContentType, 87 net::HttpRequestHeaders::kContentType,
88 "application/x-www-form-urlencoded", true); 88 "application/x-www-form-urlencoded", true);
89 request_->set_method("POST"); 89 request_->set_method("POST");
90 scoped_ptr<net::UploadElementReader> reader( 90 scoped_ptr<net::UploadElementReader> reader(
91 new net::UploadBytesElementReader( 91 new net::UploadBytesElementReader(
92 post_body_.data(), post_body_.size())); 92 post_body_.data(), post_body_.size()));
93 request_->set_upload(make_scoped_ptr( 93 request_->set_upload(make_scoped_ptr(
94 net::UploadDataStream::CreateWithReader(reader.Pass(), 0))); 94 net::UploadDataStream::CreateWithReader(reader.Pass(), 0)));
95 request_->Start(); 95 request_->Start();
(...skipping 25 matching lines...) Expand all
121 TokenValidatorFactoryImpl::CreateTokenValidator( 121 TokenValidatorFactoryImpl::CreateTokenValidator(
122 const std::string& local_jid, 122 const std::string& local_jid,
123 const std::string& remote_jid) { 123 const std::string& remote_jid) {
124 return scoped_ptr<protocol::TokenValidator>( 124 return scoped_ptr<protocol::TokenValidator>(
125 new TokenValidatorImpl(third_party_auth_config_, 125 new TokenValidatorImpl(third_party_auth_config_,
126 key_pair_, local_jid, remote_jid, 126 key_pair_, local_jid, remote_jid,
127 request_context_getter_)); 127 request_context_getter_));
128 } 128 }
129 129
130 } // namespace remoting 130 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698