Google-specific implementation of the OAuth 2.0 URL builder for an authorization web page to
allow the end user to authorize the application to access their protected resources and that
returns the access token to a browser client using a scripting language such as JavaScript, as
specified in Using OAuth
2.0 for Client-side Applications.
The default for #getResponseTypes() is "token"
.
Sample usage for a web application:
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
String url = new GoogleBrowserClientRequestUrl("812741506391.apps.googleusercontent.com",
"https://oauth2-login-demo.appspot.com/oauthcallback", 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.
Inherited Members
com.google.api.client.auth.oauth2.AuthorizationRequestUrl.getClientId()
com.google.api.client.auth.oauth2.AuthorizationRequestUrl.getRedirectUri()
com.google.api.client.auth.oauth2.AuthorizationRequestUrl.getResponseTypes()
com.google.api.client.auth.oauth2.AuthorizationRequestUrl.getScopes()
com.google.api.client.auth.oauth2.AuthorizationRequestUrl.getState()
com.google.api.client.auth.oauth2.BrowserClientRequestUrl.clone()
com.google.api.client.auth.oauth2.BrowserClientRequestUrl.set(java.lang.String,java.lang.Object)
com.google.api.client.auth.oauth2.BrowserClientRequestUrl.setClientId(java.lang.String)
com.google.api.client.auth.oauth2.BrowserClientRequestUrl.setRedirectUri(java.lang.String)
com.google.api.client.auth.oauth2.BrowserClientRequestUrl.setResponseTypes(java.util.Collection<java.lang.String>)
com.google.api.client.auth.oauth2.BrowserClientRequestUrl.setScopes(java.util.Collection<java.lang.String>)
com.google.api.client.auth.oauth2.BrowserClientRequestUrl.setState(java.lang.String)
com.google.api.client.http.GenericUrl.appendRawPath(java.lang.String)
com.google.api.client.http.GenericUrl.build()
com.google.api.client.http.GenericUrl.buildAuthority()
com.google.api.client.http.GenericUrl.buildRelativeUrl()
com.google.api.client.http.GenericUrl.equals(java.lang.Object)
com.google.api.client.http.GenericUrl.getAll(java.lang.String)
com.google.api.client.http.GenericUrl.getFirst(java.lang.String)
com.google.api.client.http.GenericUrl.getFragment()
com.google.api.client.http.GenericUrl.getHost()
com.google.api.client.http.GenericUrl.getPathParts()
com.google.api.client.http.GenericUrl.getPort()
com.google.api.client.http.GenericUrl.getRawPath()
com.google.api.client.http.GenericUrl.getScheme()
com.google.api.client.http.GenericUrl.getUserInfo()
com.google.api.client.http.GenericUrl.hashCode()
com.google.api.client.http.GenericUrl.setFragment(java.lang.String)
com.google.api.client.http.GenericUrl.setHost(java.lang.String)
com.google.api.client.http.GenericUrl.setPathParts(java.util.List<java.lang.String>)
com.google.api.client.http.GenericUrl.setPort(int)
com.google.api.client.http.GenericUrl.setRawPath(java.lang.String)
com.google.api.client.http.GenericUrl.setScheme(java.lang.String)
com.google.api.client.http.GenericUrl.setUserInfo(java.lang.String)
com.google.api.client.http.GenericUrl.toPathParts(java.lang.String)
com.google.api.client.http.GenericUrl.toPathParts(java.lang.String,boolean)
com.google.api.client.http.GenericUrl.toString()
com.google.api.client.http.GenericUrl.toURI()
com.google.api.client.http.GenericUrl.toURL()
com.google.api.client.http.GenericUrl.toURL(java.lang.String)
com.google.api.client.util.GenericData.entrySet()
com.google.api.client.util.GenericData.get(java.lang.Object)
com.google.api.client.util.GenericData.getClassInfo()
com.google.api.client.util.GenericData.getUnknownKeys()
com.google.api.client.util.GenericData.put(java.lang.String,java.lang.Object)
com.google.api.client.util.GenericData.putAll(java.util.Map<? extends java.lang.String,?>)
com.google.api.client.util.GenericData.remove(java.lang.Object)
com.google.api.client.util.GenericData.setUnknownKeys(java.util.Map<java.lang.String,java.lang.Object>)