Comments (3)
How signatures are written is defined by the SigningStrategy you use. The
default is
to write to the HTTP Authorization header. There's a QueryStringSigningStrategy
which
can be used to sign URLs, but request objects typically don't allow you to
change the
URL once it's set, making them impossible to sign this way (that's why it works
on
string objects, not request objects).
I suggest you do something like this:
OAuthConsumer consumer = new DefaultOAuthConsumer(...);
consumer.setSigningStrategy(new QueryStringSigningStrategy());
String uri = "http://yourdomain.com?you_param=x";
uri = consumer.sign(uri);
HttpURLConnection request = new URI(uri).openConnection();
...
is that what you need?
Original comment by [email protected]
on 26 Apr 2010 at 9:28
from oauth-signpost.
Yes, this works, but a simpler hack would doing the following: (I'm refering to
the
example's code)
OAuthProvider provider = new DefaultOAuthProvider(
consumer.sign("http://yourdomain/requesttoken.php"),
consumer.sign("http://yourdomain/accesstoken.php"),
consumer.sign("http://yourdomain/tokenverifier.php")
);
String authUrl = provider.retrieveRequestToken(consumer, OAuth.OUT_OF_BAND);
This works for me for time being! Thanks!
Original comment by [email protected]
on 26 Apr 2010 at 9:53
from oauth-signpost.
Original comment by [email protected]
on 9 May 2010 at 12:59
- Added labels: Type-Enhancement
- Removed labels: Type-Defect
from oauth-signpost.
Related Issues (20)
- Request: RSA-SHA1 Signing HOT 4
- retrieveRequestToken(consumer, null) fails with signpost 1.2.1.1 HOT 1
- retrieveRequestToken returns an error of 500 HOT 4
- POST support for DefaultOAuthConsumer HOT 1
- OAuthGoogleExample not executing HOT 2
- After Java upgrade: "Server returned HTTP response code: 411 for URL HOT 10
- For Android Twitter Usage HOT 3
- SignatureBaseString havent sort requestParameters
- Oauth java.lang.ClassNotFoundException: org.apache.http.HttpRequest
- Enhancement : adding license text in tarball
- didn't support HTTP GET method in this framework
- two-legged OAuth HOT 3
- Signing fails when multiple parameters with the same key are used HOT 1
- consumer key with special characters causes signpost to generate incorrect signature HOT 4
- Doesnt work on 3.2, tested on motorola xoom 3.2 HOT 5
- NULL exception after CommonsHttpOAuthProvider is de-serialized
- oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: null HOT 5
- incorrect get signing when params include space
- URL query parameter without values causes failure HOT 1
- oauth-signpost don't include the license file
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 oauth-signpost.