Class BrowserClientRequestUrl (1.32.1)

public class BrowserClientRequestUrl extends AuthorizationRequestUrl

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 Implicit Grant.

The default for #getResponseTypes() is "token".

Sample usage for a web application:

public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { String url = new BrowserClientRequestUrl( "https://server.example.com/authorize", "s6BhdRkqt3").setState("xyz") .setRedirectUri("https://client.example.com/cb").build(); response.sendRedirect(url); }

Implementation is not thread-safe.

Inheritance

Object > java.util.AbstractMap > com.google.api.client.util.GenericData > com.google.api.client.http.GenericUrl > AuthorizationRequestUrl > BrowserClientRequestUrl
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>)

Constructors

BrowserClientRequestUrl(String encodedAuthorizationServerUrl, String clientId)

public BrowserClientRequestUrl(String encodedAuthorizationServerUrl, String clientId)
Parameters
NameDescription
encodedAuthorizationServerUrlString

encoded authorization server URL

clientIdString

client identifier

Methods

clone()

public BrowserClientRequestUrl clone()
Returns Overrides

set(String fieldName, Object value)

public BrowserClientRequestUrl set(String fieldName, Object value)
Parameters
NameDescription
fieldNameString
valueObject
Returns Overrides

setClientId(String clientId)

public BrowserClientRequestUrl setClientId(String clientId)

Sets the client identifier.

Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.

Parameter
NameDescription
clientIdString
Returns Overrides

setRedirectUri(String redirectUri)

public BrowserClientRequestUrl setRedirectUri(String redirectUri)

Sets the URI that the authorization server directs the resource owner's user-agent back to the client after a successful authorization grant (as specified in Redirection Endpoint) or null for none.

Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.

Parameter
NameDescription
redirectUriString
Returns Overrides

setResponseTypes(Collection<String> responseTypes)

public BrowserClientRequestUrl setResponseTypes(Collection<String> responseTypes)

Sets the response type, which must be "code" for requesting an authorization code, "token" for requesting an access token (implicit grant), or a list of registered extension values to join with a space.

Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.

Parameter
NameDescription
responseTypesCollection<String>
Returns Overrides

setScopes(Collection<String> scopes)

public BrowserClientRequestUrl setScopes(Collection<String> scopes)

Sets the list of scopes (as specified in Access Token Scope) or null for none.

Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.

Parameter
NameDescription
scopesCollection<String>
Returns Overrides

setState(String state)

public BrowserClientRequestUrl setState(String state)

Sets the state (an opaque value used by the client to maintain state between the request and callback, as mentioned in Registration Requirements) or null for none.

Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.

Parameter
NameDescription
stateString
Returns Overrides