Class AuthorizationCodeResponseUrl
Check if getError() is null to check if the end-user granted authorization.
Sample usage:
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
StringBuffer fullUrlBuf = request.getRequestURL();
if (request.getQueryString() != null) {
fullUrlBuf.append('?').append(request.getQueryString());
}
AuthorizationCodeResponseUrl authResponse =
new AuthorizationCodeResponseUrl(fullUrlBuf.toString());
// check for user-denied error
if (authResponse.getError() != null) {
// authorization denied...
} else {
// request access token using authResponse.getCode()...
}
}
Implementation is not thread-safe.
- Since:
- 1.7
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.api.client.util.GenericData
com.google.api.client.util.GenericData.FlagsNested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringAuthorization code generated by the authorization server ornullfor none.private StringError code ("invalid_request","unauthorized_client","access_denied","unsupported_response_type","invalid_scope","server_error","temporarily_unavailable", or an extension error code as specified in Defining Additional Error Codes) ornullfor none.private StringHuman-readable text providing additional information used to assist the client developer in understanding the error that occurred ornullfor none.private StringURI identifying a human-readable web page with information about the error used to provide the client developer with additional information about the error ornullfor none.private StringState parameter matching the state parameter in the authorization request ornullfor none. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()final StringgetCode()Returns the authorization code generated by the authorization server ornullfor none.final StringgetError()Returns the error code ("invalid_request","unauthorized_client","access_denied","unsupported_response_type","invalid_scope","server_error","temporarily_unavailable", or an extension error code as specified in Defining Additional Error Codes) ornullfor none.final StringReturns the human-readable text providing additional information used to assist the client developer in understanding the error that occurred ornullfor none.final StringReturns the URI identifying a human-readable web page with information about the error used to provide the client developer with additional information about the error ornullfor none.final StringgetState()Returns the state parameter matching the state parameter in the authorization request ornullfor none.Sets the authorization code generated by the authorization server ornullfor none.Sets the error code ("invalid_request","unauthorized_client","access_denied","unsupported_response_type","invalid_scope","server_error","temporarily_unavailable", or an extension error code as specified in Defining Additional Error Codes) ornullfor none.setErrorDescription(String errorDescription) Sets the human-readable text providing additional information used to assist the client developer in understanding the error that occurred ornullfor none.setErrorUri(String errorUri) Sets the URI identifying a human-readable web page with information about the error used to provide the client developer with additional information about the error ornullfor none.Sets the state parameter matching the state parameter in the authorization request ornullfor none.Methods inherited from class com.google.api.client.http.GenericUrl
appendRawPath, 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, toURLMethods inherited from class com.google.api.client.util.GenericData
entrySet, get, getClassInfo, getUnknownKeys, put, putAll, remove, setUnknownKeysMethods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, isEmpty, keySet, size, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
code
Authorization code generated by the authorization server ornullfor none. -
state
State parameter matching the state parameter in the authorization request ornullfor none. -
error
Error code ("invalid_request","unauthorized_client","access_denied","unsupported_response_type","invalid_scope","server_error","temporarily_unavailable", or an extension error code as specified in Defining Additional Error Codes) ornullfor none. -
errorDescription
Human-readable text providing additional information used to assist the client developer in understanding the error that occurred ornullfor none. -
errorUri
URI identifying a human-readable web page with information about the error used to provide the client developer with additional information about the error ornullfor none.
-
-
Constructor Details
-
AuthorizationCodeResponseUrl
- Parameters:
encodedResponseUrl- encoded authorization code response URL
-
-
Method Details
-
getCode
Returns the authorization code generated by the authorization server ornullfor none. -
setCode
Sets the authorization code generated by the authorization server ornullfor none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
getState
Returns the state parameter matching the state parameter in the authorization request ornullfor none. -
setState
Sets the state parameter matching the state parameter in the authorization request ornullfor none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
getError
Returns the error code ("invalid_request","unauthorized_client","access_denied","unsupported_response_type","invalid_scope","server_error","temporarily_unavailable", or an extension error code as specified in Defining Additional Error Codes) ornullfor none. -
setError
Sets the error code ("invalid_request","unauthorized_client","access_denied","unsupported_response_type","invalid_scope","server_error","temporarily_unavailable", or an extension error code as specified in Defining Additional Error Codes) ornullfor none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
getErrorDescription
Returns the human-readable text providing additional information used to assist the client developer in understanding the error that occurred ornullfor none. -
setErrorDescription
Sets the human-readable text providing additional information used to assist the client developer in understanding the error that occurred ornullfor none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
getErrorUri
Returns the URI identifying a human-readable web page with information about the error used to provide the client developer with additional information about the error ornullfor none. -
setErrorUri
Sets the URI identifying a human-readable web page with information about the error used to provide the client developer with additional information about the error ornullfor none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
set
- Overrides:
setin classcom.google.api.client.http.GenericUrl
-
clone
- Overrides:
clonein classcom.google.api.client.http.GenericUrl
-