David Landes
David Landes

Reputation: 398

Spring Security Oauth with existing Oauth token

I'm currently building an application with Spring and I am trying to connect to an external application. The application's resources are protected by Oauth 1.0 and I already have the consumer key, consumer secret, oauth token, and oauth token secret. Is there a way to just use this information to obtain the resources or do I have to request a new oauth token every time? If I have to get a new token every time, then is there a good tutorial on how to do this? It would be much appreciated.

Upvotes: 2

Views: 261

Answers (1)

TR1
TR1

Reputation: 323

It depends on how the external application is built.

If the token you have is an access token and never expires - then you don't need to get a new token every time - just use it till it expires.

If the token you have is a request token - you would need to have this token authorized first (commonly by sending a web request to the application) and exchange it for an access token (commonly a successful response will contain the access token).

You mention that you have the token secret - so I am guessing it's an access token which will be valid as long as you are subscribed to the external applications service. So it seems like you might have all the information necessary to make an OAuth 1.0 request.

The best guide on the web for OAuth 1.0 I have come across is at - http://hueniverse.com/oauth/guide/

Upvotes: 1

Related Questions