Skip to content

Commit efc54d4

Browse files
committed
OAuth2 and OAuth1 support should be enabled through http_client::add_handler.
1 parent 370450d commit efc54d4

File tree

5 files changed

+2
-63
lines changed

5 files changed

+2
-63
lines changed

Release/include/cpprest/http_client.h

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,6 @@ typedef void* native_handle;}}}
5151
#include "cpprest/details/basic_types.h"
5252
#include "cpprest/asyncrt_utils.h"
5353

54-
#if !defined(CPPREST_TARGET_XP)
55-
#include "cpprest/oauth1.h"
56-
#endif
57-
58-
#include "cpprest/oauth2.h"
59-
6054
#if !defined(_WIN32) && !defined(__cplusplus_winrt)
6155
#if defined(__clang__)
6256
#pragma clang diagnostic push
@@ -109,44 +103,6 @@ class http_client_config
109103
{
110104
}
111105

112-
#if !defined(CPPREST_TARGET_XP)
113-
/// <summary>
114-
/// Get OAuth 1.0 configuration.
115-
/// </summary>
116-
/// <returns>Shared pointer to OAuth 1.0 configuration.</returns>
117-
const std::shared_ptr<oauth1::experimental::oauth1_config> oauth1() const
118-
{
119-
return m_oauth1;
120-
}
121-
122-
/// <summary>
123-
/// Set OAuth 1.0 configuration.
124-
/// </summary>
125-
/// <param name="config">OAuth 1.0 configuration to set.</param>
126-
void set_oauth1(oauth1::experimental::oauth1_config config)
127-
{
128-
m_oauth1 = std::make_shared<oauth1::experimental::oauth1_config>(std::move(config));
129-
}
130-
#endif
131-
132-
/// <summary>
133-
/// Get OAuth 2.0 configuration.
134-
/// </summary>
135-
/// <returns>Shared pointer to OAuth 2.0 configuration.</returns>
136-
const std::shared_ptr<oauth2::experimental::oauth2_config> oauth2() const
137-
{
138-
return m_oauth2;
139-
}
140-
141-
/// <summary>
142-
/// Set OAuth 2.0 configuration.
143-
/// </summary>
144-
/// <param name="config">OAuth 2.0 configuration to set.</param>
145-
void set_oauth2(oauth2::experimental::oauth2_config config)
146-
{
147-
m_oauth2 = std::make_shared<oauth2::experimental::oauth2_config>(std::move(config));
148-
}
149-
150106
/// <summary>
151107
/// Get the web proxy object
152108
/// </summary>
@@ -368,11 +324,6 @@ class http_client_config
368324
#endif
369325

370326
private:
371-
#if !defined(CPPREST_TARGET_XP)
372-
std::shared_ptr<oauth1::experimental::oauth1_config> m_oauth1;
373-
#endif
374-
375-
std::shared_ptr<oauth2::experimental::oauth2_config> m_oauth2;
376327
web_proxy m_proxy;
377328
http::client::credentials m_credentials;
378329
// Whether or not to guarantee ordering, i.e. only using one underlying TCP connection.

Release/src/http/client/http_client.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -380,13 +380,6 @@ http_client::http_client(const uri &base_uri, const http_client_config &client_c
380380

381381
m_pipeline = std::make_shared<http_pipeline>(std::move(final_pipeline_stage));
382382

383-
#if !defined(CPPREST_TARGET_XP)
384-
add_handler(std::static_pointer_cast<http::http_pipeline_stage>(
385-
std::make_shared<oauth1::details::oauth1_handler>(client_config.oauth1())));
386-
#endif
387-
388-
add_handler(std::static_pointer_cast<http::http_pipeline_stage>(
389-
std::make_shared<oauth2::details::oauth2_handler>(client_config.oauth2())));
390383
}
391384

392385
http_client::~http_client() CPPREST_NOEXCEPT {}

Release/src/http/oauth/oauth1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
****/
2525

2626
#include "stdafx.h"
27-
27+
#include "cpprest/oauth1.h"
2828
#if !defined(CPPREST_TARGET_XP)
2929

3030
using namespace utility;

Release/src/http/oauth/oauth2.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
****/
2525

2626
#include "stdafx.h"
27+
#include "cpprest/oauth2.h"
2728

2829
using web::http::client::http_client;
2930
using web::http::client::http_client_config;

Release/src/pch/stdafx.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,6 @@
132132
#include "cpprest/http_client.h"
133133
#include "cpprest/details/http_helpers.h"
134134

135-
// oauth
136-
#if !defined(_WIN32) || _WIN32_WINNT >= _WIN32_WINNT_VISTA
137-
#include "cpprest/oauth1.h"
138-
#endif
139-
#include "cpprest/oauth2.h"
140-
141135
// websockets
142136
#include "cpprest/ws_client.h"
143137
#include "cpprest/ws_msg.h"

0 commit comments

Comments
 (0)