Sorry I believe you are correct that the EchoServlet is currently written to
only support 3-Legged OAuth. I think by changing the EchoServlet in the
following ways it should support 2-Legged.
1) Instead of
OAuthAccessor accessor = SampleOAuthProvider.getAccessor(requestMessage);
Use
final OAuthConsumer consumer =
SampleOAuthProvider.getConsumer(requestMessage);
final OAuthAccessor accessor = new OAuthAccessor(consumer);
2) You may also need to add the init(ServletConfig c) method to the
EchoServlet to load the properties file.
public void init(ServletConfig config) throws ServletException {
super.init(config);
try {
SampleOAuthProvider.loadConsumers(config);
}catch(IOException e) {
throw new ServletException(e);
}
}
Sorry again for my poor guidance,
Rob
On Fri, Oct 16, 2009 at 2:08 AM, Anuradha Thota <[email protected]>wrote:
>
>
> Hi,
> Iam passing accessToken as null now.Even then i get the same exception
> that token has been expired inside SampleOAuthProvider.getAccessor()
> Inside this method,it is checking for tokens and since they are coming
> as null accessor object is set to null as a result of which we are
> getting OAuthProblemException("token_expired");
> My assumption is that what EchoServlet(as suggested by John and
> Robert) is following 3 legged verification.
> So request you to suggest 2-legged way of verification.
> Regards,
> Anuradha
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"OAuth" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/oauth?hl=en
-~----------~----~----~----~------~----~------~--~---