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
446446 // / Default: "access_token".
447447 // / </summary>
448448 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+ }
449467
450468private:
451469 friend class web ::http::client::http_client_config;
@@ -483,6 +501,8 @@ class oauth2_config
483501 utility::string_t m_scope;
484502 utility::string_t m_state;
485503
504+ web::web_proxy m_proxy;
505+
486506 bool m_implicit_grant;
487507 bool m_bearer_auth;
488508 bool m_http_basic_auth;
Original file line number Diff line number Diff line change 2626#include " stdafx.h"
2727
2828using web::http::client::http_client;
29+ using web::http::client::http_client_config;
2930using web::http::oauth2::details::oauth2_strings;
3031using web::http::details::mime_types;
3132using utility::conversions::to_utf8string;
@@ -134,7 +135,11 @@ pplx::task<void> oauth2_config::_request_token(uri_builder& request_body_ub)
134135 }
135136 request.set_body (request_body_ub.query (), mime_types::application_x_www_form_urlencoded);
136137
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);
138143
139144 return token_client.request (request)
140145 .then ([](http_response resp)
You can’t perform that action at this time.
0 commit comments