public class AuthorizationCodeRequestUrl extends AuthorizationRequestUrl
The default for AuthorizationRequestUrl.getResponseTypes() is "code". Use
AuthorizationCodeResponseUrl to parse the redirect response after the end user
grants/denies the request. Using the authorization code in this response, use
AuthorizationCodeTokenRequest to request the access token.
Sample usage for a web application:
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
String url =
new AuthorizationCodeRequestUrl("https://server.example.com/authorize", "s6BhdRkqt3")
.setState("xyz").setRedirectUri("https://client.example.com/rd").build();
response.sendRedirect(url);
}
Implementation is not thread-safe.
com.google.api.client.util.GenericData.Flags| Constructor and Description |
|---|
AuthorizationCodeRequestUrl(java.lang.String authorizationServerEncodedUrl,
java.lang.String clientId) |
| Modifier and Type | Method and Description |
|---|---|
AuthorizationCodeRequestUrl |
clone() |
AuthorizationCodeRequestUrl |
set(java.lang.String fieldName,
java.lang.Object value) |
AuthorizationCodeRequestUrl |
setClientId(java.lang.String clientId)
Sets the client identifier.
|
AuthorizationCodeRequestUrl |
setRedirectUri(java.lang.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. |
AuthorizationCodeRequestUrl |
setResponseTypes(java.util.Collection<java.lang.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. |
AuthorizationCodeRequestUrl |
setScopes(java.util.Collection<java.lang.String> scopes)
Sets the list of scopes (as specified in Access Token Scope) or
null
for none. |
AuthorizationCodeRequestUrl |
setState(java.lang.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. |
getClientId, getRedirectUri, getResponseTypes, getScopes, getStateappendRawPath, build, buildAuthority, buildRelativeUrl, equals, getAll, getFirst, getFragment, getHost, getPathParts, getPort, getRawPath, getScheme, getUserInfo, hashCode, setFragment, setHost, setPathParts, setPort, setRawPath, setScheme, setUserInfo, toPathParts, toString, toURI, toURL, toURLentrySet, get, getClassInfo, getUnknownKeys, put, putAll, remove, setUnknownKeysclear, containsKey, containsValue, isEmpty, keySet, size, valuespublic AuthorizationCodeRequestUrl(java.lang.String authorizationServerEncodedUrl,
java.lang.String clientId)
authorizationServerEncodedUrl - authorization server encoded URLclientId - client identifierpublic AuthorizationCodeRequestUrl setResponseTypes(java.util.Collection<java.lang.String> responseTypes)
AuthorizationRequestUrl"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.
setResponseTypes in class AuthorizationRequestUrlpublic AuthorizationCodeRequestUrl setRedirectUri(java.lang.String redirectUri)
AuthorizationRequestUrlnull for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
setRedirectUri in class AuthorizationRequestUrlpublic AuthorizationCodeRequestUrl setScopes(java.util.Collection<java.lang.String> scopes)
AuthorizationRequestUrlnull
for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
setScopes in class AuthorizationRequestUrlscopes - collection of scopes to be joined by a space separator (or a single value
containing multiple space-separated scopes) or null for nonepublic AuthorizationCodeRequestUrl setClientId(java.lang.String clientId)
AuthorizationRequestUrlOverriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
setClientId in class AuthorizationRequestUrlpublic AuthorizationCodeRequestUrl setState(java.lang.String state)
AuthorizationRequestUrlnull for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
setState in class AuthorizationRequestUrlpublic AuthorizationCodeRequestUrl set(java.lang.String fieldName, java.lang.Object value)
set in class AuthorizationRequestUrlpublic AuthorizationCodeRequestUrl clone()
clone in class AuthorizationRequestUrlCopyright © 2011-2018 Google. All Rights Reserved.