Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Trusted Contributor
jppedroso
Posts: 119
Registered: ‎04-29-2010
My Device: Curve 8520
My Carrier: TMN
Accepted Solution

Twitter: Could not authenticate with OAuth.

Hi, I'm getting the following exception:

 

java.lang.SecurityException: Could not authenticate with OAuth.

 

Code:

			Credential c = new Credential(CONSUMER_KEY, CONSUMER_SECRET, tTOK);
			UserAccountManager uam = UserAccountManager.getInstance(c);
		
			try {
				if (uam.verifyCredential()) {
					TweetER.getInstance(uam).post(new Tweet(sTweet));
					System.out.println( _res.getString(I18N_MSG_TWITTEROK));
					//Dialog.inform( _res.getString(I18N_MSG_TWITTEROK));					
				}
			} catch (Exception e) {

				System.out.println("Error by posting tweet:" + e);
				//Dialog.inform("Error posting Tweet: " + e);
			}

 

and it allways thows the exception on the line: TweetER.getInstance(uam).post(new Tweet(sTweet));

 

I'm using a sample from Twitter API ME http://kenai.com/projects/twitterapime/pages/Home

 

I've already created the Twitter Application and got Consumer Key and Secret.

 

Does someone has a clue of what could be the problem?

 

Thks!

 

................................................................................................
Tech On!
PTNews
more at On On On!
Please use plain text.
Developer
pankajace12
Posts: 192
Registered: ‎04-30-2011
My Device: Software
My Carrier: Airtel

Re: Twitter: Could not authenticate with OAuth.

Please use plain text.
Trusted Contributor
jppedroso
Posts: 119
Registered: ‎04-29-2010
My Device: Curve 8520
My Carrier: TMN

Re: Twitter: Could not authenticate with OAuth.

thks a lot, I tried that code and worked perfectly!

................................................................................................
Tech On!
PTNews
more at On On On!
Please use plain text.
Developer
pankajace12
Posts: 192
Registered: ‎04-30-2011
My Device: Software
My Carrier: Airtel

Re: Twitter: Could not authenticate with OAuth.

Welcome Jppedroso

Pawan
Please use plain text.