Comments (1)
This looks like it was an issue with double-encoding the signature in query strings, things probably were working fine with Auth HTTP headers. You can see the double-encoding since the oauth_signature ends with %253D (%25 is the reencoding of %, %3D is '=').
This should be fixed in 4db410f and I added a couple of other fixes for the samples since the Twitter URLs were out of date and one now requires a oauth_callback parameter.
Here's a small patch you can use to very easily run those applications against imgur and verify this is actually fixed for you. It just sets up the right endpoints and makes the simple_request binary get the json listing of your images:
diff --git a/demo/simple_auth.cpp b/demo/simple_auth.cpp
index 98488e5..b61dbcd 100644
--- a/demo/simple_auth.cpp
+++ b/demo/simple_auth.cpp
@@ -9,10 +9,10 @@
*/
std::string consumer_key = ""; // Key from Twitter
std::string consumer_secret = ""; // Secret from Twitter
-std::string request_token_url = "https://api.twitter.com/oauth/request_token";
-std::string request_token_query_args = "oauth_callback=oob";
-std::string authorize_url = "https://api.twitter.com/oauth/authorize";
-std::string access_token_url = "https://api.twitter.com/oauth/access_token";
+std::string request_token_url = "https://api.imgur.com/oauth/request_token";
+std::string request_token_query_args = "";
+std::string authorize_url = "https://api.imgur.com/oauth/authorize";
+std::string access_token_url = "https://api.imgur.com/oauth/access_token";
std::string getUserString(std::string prompt) {
diff --git a/demo/simple_request.cpp b/demo/simple_request.cpp
index 215d76b..443ede2 100644
--- a/demo/simple_request.cpp
+++ b/demo/simple_request.cpp
@@ -12,8 +12,8 @@ std::string consumer_secret = ""; // Secret from Twitter
std::string oauth_token = ""; // User-specific token acquired by auth process
std::string oauth_token_secret = ""; // User-specific secret acquired by auth process.
// An example resource to be accessed, along with parameters for the request
-std::string oauth_protected_resource = "https://api.twitter.com/1/statuses/home_timeline.json";
-std::string oauth_protected_resource_params = "count=5";
+std::string oauth_protected_resource = "http://api.imgur.com/2/account/images.json";
+std::string oauth_protected_resource_params = "";
std::string getUserString(std::string prompt) {
std::cout << prompt << " ";
from liboauthcpp.
Related Issues (16)
- segfault for too long urls HOT 1
- Duplicate oauth_nonce HOT 2
- MinGW/MSYS compilation fails due to wrong compiler parameters being set
- CMake does not build an x64 version of the lib HOT 2
- Beautiful library! HOT 2
- Problem with two parameters with same name HOT 2
- Tumblr returns 'oauth_signature does not match expected value' on requesting a token HOT 1
- Some suggested fixes for compiling x64 version in Visual Studio 2013
- Can we upgrade to OAuth2 please HOT 1
- Compile warning character constant too long
- liboauthcpp.cpp bool Client::getSignature(..., bool do_urlencode) HOT 4
- My John Deere Api does not accept authorization request
- how to use simple_auth and simple_request
- Duplicate oauth_nonce timestamps on fast requests HOT 1
- Chars to exclude from percent encoding HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from liboauthcpp.