File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -446,6 +446,24 @@ class oauth2_config
446
446
// / Default: "access_token".
447
447
// / </summary>
448
448
void set_access_token_key (utility::string_t access_token_key) { m_access_token_key = std::move (access_token_key); }
449
+
450
+ // / <summary>
451
+ // / Get the web proxy object
452
+ // / </summary>
453
+ // / <returns>A reference to the web proxy object.</returns>
454
+ const web_proxy& proxy () const
455
+ {
456
+ return m_proxy;
457
+ }
458
+
459
+ // / <summary>
460
+ // / Set the web proxy object that will be used by token_from_code and token_from_refresh
461
+ // / </summary>
462
+ // / <param name="proxy">A reference to the web proxy object.</param>
463
+ void set_proxy (const web_proxy& proxy)
464
+ {
465
+ m_proxy = proxy;
466
+ }
449
467
450
468
private:
451
469
friend class web ::http::client::http_client_config;
@@ -483,6 +501,8 @@ class oauth2_config
483
501
utility::string_t m_scope;
484
502
utility::string_t m_state;
485
503
504
+ web::web_proxy m_proxy;
505
+
486
506
bool m_implicit_grant;
487
507
bool m_bearer_auth;
488
508
bool m_http_basic_auth;
Original file line number Diff line number Diff line change 26
26
#include " stdafx.h"
27
27
28
28
using web::http::client::http_client;
29
+ using web::http::client::http_client_config;
29
30
using web::http::oauth2::details::oauth2_strings;
30
31
using web::http::details::mime_types;
31
32
using utility::conversions::to_utf8string;
@@ -134,7 +135,11 @@ pplx::task<void> oauth2_config::_request_token(uri_builder& request_body_ub)
134
135
}
135
136
request.set_body (request_body_ub.query (), mime_types::application_x_www_form_urlencoded);
136
137
137
- http_client token_client (token_endpoint ());
138
+ // configure proxy
139
+ http_client_config config;
140
+ config.set_proxy (m_proxy);
141
+
142
+ http_client token_client (token_endpoint (), config);
138
143
139
144
return token_client.request (request)
140
145
.then ([](http_response resp)
You can’t perform that action at this time.
0 commit comments