Search code examples
javaoauthlinkedin-apiscribe

how to obtain a "request token" in callback servlet?


I posted this question already to scribe-java github. I wonder, where I can get Token object inside my callback servlet, if I only have a String from LinkedIn server. This is how Scribe wants me to retrieve an "access token":

OAuthService#getAccessToken(token, verifier);

I can't instantiate token from a String, since its constructor requires also a secret. Can somebody explain what do I miss here?


Solution

  • Long story short, you should keep the Token object between requests, or at least the two strings that conform it and recreate like this:

    Token t = new Token(token, secret);