Thursday, 15 August 2013

Exchange code for access token and id token for google oauth java

Exchange code for access token and id token for google oauth java

I want to store access token in session and if session is store then set
accessToken and get the current user using Google OAuth..
I got the code from Git Hub Click here. build on java eclipse maven build
it war file and paste in tomcat. Code Work perfectly. i dont know how to
get access token from google response code.
when i click om button it redirects to google oauth and after redirect to
my callback url it response like
https://localhost:8080/oauth/index.jsp?state=google&code=4/P7q7W91a-oMsCeLvIaQm6bTrgtp7
from that code behalf if fetches the user information. but i need to store
the access token which extract from that code. I got the reference from
Google developers site but i can't figure out how to extract access token
from that code and refresh access token to extend the token expiration.
or any other reference / tutorial for google o-auth that build on java web
based plz share.

No comments:

Post a Comment