Giter VIP home page Giter VIP logo

Comments (3)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 16, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 16, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.