google.com/apis/accounts/docs/OAuth2WebServer.html">Using OAuth 2.0 for Web Server Applications (Experimental).
The default for {@link #getResponseTypes()} is {@code "code"}. Use {@link AuthorizationCodeResponseUrl} to parse the redirect response after the end usergrants/denies the request. Using the authorization code in this response, use {@link GoogleAuthorizationCodeTokenRequest} to request the access token.
Sample usage for a web application:
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { String url = new GoogleAuthorizationCodeRequestUrl("812741506391.apps.googleusercontent.com", "https://oauth2-login-demo.appspot.com/code", Arrays.asList( "https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile")).setState("/profile").build(); response.sendRedirect(url); }
Implementation is not thread-safe.
@since 1.7
@author Yaniv Inbar