Hi everyone !
I'm looking for a solution to run my connection oauth with google
chrome. currently my code only works on firefox and IE but not on
google chrome because when I persist in my OAuthTokenSecret a session
variable when google redirect back on my aplication the value of the
OAuthTokenSecret in the session variable has changed.
my code JAVA :
step one index.jsp
GoogleOAuthParameters oauthParameters = new GoogleOAuthParameters();
oauthParameters.setOAuthConsumerKey(CONSUMER_KEY);
oauthParameters.setOAuthConsumerSecret(CONSUMER_SECRET);
oauthParameters.setScope("https://www.google.com/calendar/feeds/
https://spreadsheets.google.com/feeds/");
oauthParameters.setOAuthCallback("http://myappengine/connect.jsp");
GoogleOAuthHelper oauthHelper = new GoogleOAuthHelper(new
OAuthHmacSha1Signer());
oauthHelper.getUnauthorizedRequestToken(oauthParameters);
String unauth = oauthParameters.getOAuthTokenSecret();
request.getSession(true).setAttribute("accessTokenSecret",
unauth);
out.println("<a
href='"+oauthHelper.createUserAuthorizationUrl(oauthParameters)+"'>log
in</a>");
step two after redirect connect.jsp
//google chrome on the value changes each time I refreshed the page
String Unauthorizedtoken =
(String)request.getSession(true).getAttribute("accessTokenSecret");
GoogleOAuthParameters oauthParameters = new
GoogleOAuthParameters();
oauthParameters.setOAuthConsumerKey(CONSUMER_KEY);
oauthParameters.setOAuthConsumerSecret(CONSUMER_SECRET);
oauthParameters.setOAuthTokenSecret(Unauthorizedtoken);
GoogleOAuthHelper oauthHelper = new GoogleOAuthHelper(new
OAuthHmacSha1Signer());
oauthHelper.getOAuthParametersFromCallback(request.getQueryString(),
oauthParameters);
String accessToken =oauthHelper.getAccessToken(oauthParameters);
String accessTokenSecret =
oauthParameters.getOAuthTokenSecret();
People, your help is really needed here.
Thanks,
Christopher
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" 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/google-appengine-java?hl=en.