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
- Create a Controller which create a request to Google API, you need to pass api_key,secret and can pass redirect_url with other information.
- Redirect user to Google and let him/her authorize your application
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
Verifier verifier = new Verifier(oauth_verifier);
Token accessToken = oAuthGetAccessToken.getAccessToken((Token) session.get(OAuthConstants.REQUEST_TOKEN), verifier, service);
service.signRequest(accessToken, request);
Response response = request.send();
What actually is happening, we created a verifier with the help of verifier token send by Google when user redirected back,we got access_token
from 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.