I want to fetch contacts from gmail. for this I am using Sribe using GoogleExample.java
Which is working properly and giving me token.
For authorization it is giving me link like
https://www.google.com/accounts/OAuthAuthorizeToken?oauth_token=**
I am doing connection process successfully with google,
1) I want to fetch users contact from his account I am not getting it how to do it. Please provide any example
2) for authorization i have to manually copy link i dont want to do it manually.
Using struts2 for developing this project.
You do not need to do authorization manually,in scribe this has been done for demo purpose and you have way to do this.
follow below mention steps
redirect URL tell any OAuth/OpenID provider where to redirect user back once he/she authorize/reject your application
on redirection back, Google will provide you a authorization token.you can than connect to the Google API to fetch user contacts
this is a demo code how you can fetch data from Google once user redirect back to your site
What actually is happening, we created a verifier with the help of verifier token send by Google when user redirected back,we got
access_tokenfrom the Google internally which work as a key to access user data and finally we sent request to Google API to fetch data.Please be sure to set the scope in your initial request which tell service provider what all data you want to access from the user profile.