Hi,
i am implementing the openid + oauth (hybrid protocol) getting the
request_token as part of openid response, i have information like
domain name (registered with google) and its secret key (which is
working fine on standAlone java program).
Now i am trying to cosnumer key and its secret key to exchange for an
access token.
How can i do this step using Google Data API java library.
My code is here :
GoogleOAuthParameters oAuthParameters = new
GoogleOAuthParameters();
oAuthParameters.setOAuthConsumerKey(cosnumerkey);
oAuthParameters.setOAuthConsumerSecret(consumersecret);
OAuthHmacSha1Signer signer = new
OAuthHmacSha1Signer();
calendarService = new CalendarService("example-app");
try
{
calendarService.setOAuthCredentials(oAuthParameters, signer);
URL feedUrl = new URL("https://
www.google.com/
calendar/feeds/default/allcalendars/full");
calendarService.getFeed(feedUrl,
CalendarFeed.class);
}
catch (OAuthException e)
{
e.printStackTrace();
}
I am getting exception
Caused by: com.google.gdata.client.authn.oauth.OAuthException:
oauth_token does not exist.
at
com.google.gdata.client.authn.oauth.OAuthParameters.assertExists(OAuthParam
eters.java:
612)
at
com.google.gdata.client.authn.oauth.OAuthParameters.assertOAuthTokenExists(
OAuthParameters.java:
387)
at
com.google.gdata.client.authn.oauth.OAuthHelper.getAuthorizationHeader(OAut
hHelper.java:
609)
at com.google.gdata.client.GoogleAuthTokenFactory
$OAuthToken.getAuthorizationHeader(GoogleAuthTokenFactory.java:208)
i am getting the above exception. so added this statement to
oAuthParameters object.
oAuthParameters.setOAuthToken(oauthRequestToken);
Then it is giving error oauth_token_scret does not exist.
com.google.gdata.client.authn.oauth.OAuthException:
oauth_token_secret does not exist.
at
com.google.gdata.client.authn.oauth.OAuthParameters.assertExists(OAuthParam
eters.java:
612)
at
com.google.gdata.client.authn.oauth.OAuthParameters.assertOAuthTokenSecretE
xists(OAuthParameters.java:
425)
at
com.google.gdata.client.authn.oauth.OAuthHelper.getAuthorizationHeader(OAut
hHelper.java:
611)
at com.google.gdata.client.GoogleAuthTokenFactory
$OAuthToken.getAuthorizationHeader(GoogleAuthTokenFactory.java:208)
anyone help me how to get access token when working with
openID +
OAuth in action.
Thanks.
--
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.