Java2Me : Failed to validate oAuth

  12 posts   Feedicon  
Replies: 11 - Last Post: December 19, 2011 16:05
by: Ernandes Mourao Junior
showing 1 - 12 of 12
 
Posted: November 13, 2011 19:53 by sibPutnik
Hi. I can't make authenticat with OAuth on Java2ME. Error report is "Failed to validate oAuth signature and token".

MIDletOAuthDialogWrapper page = new MIDletOAuthDialogWrapper(this);
page.setConsumerKey(CONSUMER_KEY);
page.setConsumerSecret(CONSUMER_SECRET);
page.setCallbackUrl("http://chirica.do.am/");
page.setOAuthListener(new OAuthDialogListener() {...});
page.login();


CONSUMER_KEY and CONSUMER_SECRET a take from my apps page on twitter.
Device Nokia 3110c.
What is the reason of the problem and how can I fix it?
 
Posted: November 14, 2011 11:29 by Ernandes Mourao Junior
First off, please make sure your device's date, time and timezone are correct.
 
Posted: November 14, 2011 13:13 by sibPutnik
Ok! This help me. But to fix this bug I set not my timezone. I think about this and will write my dessision.
 
Posted: November 14, 2011 16:45 by Ernandes Mourao Junior
It is not a bug. OAuth algoritm requires the correct date/time to work properly.
 
Posted: November 14, 2011 15:56 by sibPutnik
Next step. I have PIN and I want to auth user. But when I invoke MIDletOAuthDialogWrapper.login(PIN) I have exception: "Invalid state: call login() method first". But, when I call MIDletOAuthDialogWrapper.login(), by app is closing and browser opens, so any steps in my App after it can not be made.

1. login();
<app closed>

2. login(PIN)
<exception>

How can I fix it?
 
Posted: November 14, 2011 16:46 by Ernandes Mourao Junior
Unfortunately, if your app is closed, you cannot authenticate, since we need the instace of MIDletOAuthDialogWrapper alive. It keeps some internal state required to complete the process.
 
Posted: November 14, 2011 19:25 by sibPutnik
May be Token data it can be stored in midlets RecordStore ?
 
Posted: November 16, 2011 12:05 by Ernandes Mourao Junior
It is not only one token we are talking about.
 
Posted: November 14, 2011 19:33 by sibPutnik
If the user exits the application, whether or not he will be authorized again the next time? What data should be stored to make authorization automatically next time?
 
Posted: November 16, 2011 12:06 by Ernandes Mourao Junior
Once you are authenticated and you have your access token, it is your app's responsability to store it and further usage.
 
Posted: December 15, 2011 20:33 by scharffc
Hi

I get the following error message:
java.lang.NoClassDefFoundError: com/twitterapime/xauth/ui/TwitterAPIMEJavaMEOAuthSample: com/twitterapime/xauth/ui/OAuthDialogListener
Do you have any guidance on how to solve this?
Thanks
Christelle
 
Posted: December 19, 2011 16:05 by Ernandes Mourao Junior
Hi,

You are forgetting to mark Twitter API ME lib in Project -> Properties ->Build Path -> Order & Export.

If you do not do that, the lib wont be packaged along with your source code.

Regards,
showing 1 - 12 of 12
Replies: 11 - Last Post: December 19, 2011 16:05
by: Ernandes Mourao Junior
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120518.3c65429)
 
 
Close
loading
Please Confirm
Close