OAuth Request token = null in android app
Posted
by jonney
on Stack Overflow
See other posts from Stack Overflow
or by jonney
Published on 2010-06-04T15:35:53Z
Indexed on
2010/06/07
20:32 UTC
Read the original article
Hit count: 258
Hi, i am trying to authenticate something(in this case LinkedIn) using OAuth but the requested token always returns null?
Here is my code below:
public void authenticateAppOauthApi() {
Log.d(TAG, "authenticateAppOauthApi");
OAuthServiceProvider provider = new OAuthServiceProvider(
REQUEST_TOKEN_PATH, AUTHORIZE_PATH, ACCESS_TOKEN_PATH);
OAuthConsumer consumer = new OAuthConsumer(CALLBACK_URL, API_KEY,
SECRET_KEY, provider);
OAuthAccessor accessor = new OAuthAccessor(consumer);
Intent intent = new Intent(Intent.ACTION_VIEW);
Log.d(TAG, "Intent intent = new Intent(Intent.ACTION_VIEW );");
// intent.setData(Uri.parse(url));
String url = accessor.consumer.serviceProvider.userAuthorizationURL
+ "?oauth_token=" + accessor.requestToken + "&oauth_callback="
+ accessor.consumer.callbackURL;
intent.setData(Uri.parse(url));
Log.d(TAG, "intent.setData(Uri.parse(url)); = " + url);
mContext.startActivity(intent);
Log.d(TAG, "finish authenticateApp");
}
I basicaly followed the example here http://donpark.org/blog/2009/01/24/android-client-side-oauth
thanks in advance
© Stack Overflow or respective owner