|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap<String,Object>
com.google.api.client.util.GenericData
com.google.api.client.http.GenericUrl
com.google.api.client.auth.oauth2.AuthorizationRequestUrl
com.google.api.client.auth.oauth2.BrowserClientRequestUrl
public class BrowserClientRequestUrl
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 AuthorizationRequestUrl.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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.util.AbstractMap |
|---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
BrowserClientRequestUrl(String encodedAuthorizationServerUrl,
String clientId)
|
|
| Method Summary | |
|---|---|
BrowserClientRequestUrl |
setClientId(String clientId)
Sets the client identifier. |
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. |
BrowserClientRequestUrl |
setResponseTypes(Iterable<String> responseTypes)
Sets the list of response types, each of which must be "code", "token", or a
registered extension value (as specified in Response Type). |
BrowserClientRequestUrl |
setResponseTypes(String... responseTypes)
Sets the list of response types, each of which must be "code", "token", or a
registered extension value (as specified in Response Type). |
BrowserClientRequestUrl |
setScopes(Iterable<String> scopes)
Sets the list of scopes (as specified in Access Token Scope) or null for none. |
BrowserClientRequestUrl |
setScopes(String... scopes)
Sets the list of scopes (as specified in Access Token Scope) or null for none. |
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. |
| Methods inherited from class com.google.api.client.auth.oauth2.AuthorizationRequestUrl |
|---|
getClientId, getRedirectUri, getResponseTypes, getScopes, getState |
| Methods inherited from class com.google.api.client.http.GenericUrl |
|---|
appendRawPath, build, clone, equals, getAll, getFirst, getFragment, getHost, getPathParts, getPort, getRawPath, getScheme, hashCode, setFragment, setHost, setPathParts, setPort, setRawPath, setScheme, toPathParts, toString |
| Methods inherited from class com.google.api.client.util.GenericData |
|---|
entrySet, get, getUnknownKeys, put, putAll, remove, set, setUnknownKeys |
| Methods inherited from class java.util.AbstractMap |
|---|
clear, containsKey, containsValue, isEmpty, keySet, size, values |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BrowserClientRequestUrl(String encodedAuthorizationServerUrl,
String clientId)
encodedAuthorizationServerUrl - encoded authorization server URLclientId - client identifier| Method Detail |
|---|
public BrowserClientRequestUrl setResponseTypes(String... responseTypes)
AuthorizationRequestUrl"code", "token", or a
registered extension value (as specified in Response Type).
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
setResponseTypes in class AuthorizationRequestUrlresponseTypes - response types to be joined by a space separator (or a single value
containing multiple space-separated scopes)public BrowserClientRequestUrl setResponseTypes(Iterable<String> responseTypes)
AuthorizationRequestUrl"code", "token", or a
registered extension value (as specified in Response Type).
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
setResponseTypes in class AuthorizationRequestUrlresponseTypes - response types to be joined by a space separator (or a single value
containing multiple space-separated scopes)public BrowserClientRequestUrl setRedirectUri(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 BrowserClientRequestUrl setScopes(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 - list of scopes to be joined by a space separator (or a single value containing
multiple space-separated scopes) or null for nonepublic BrowserClientRequestUrl setScopes(Iterable<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 - list of scopes to be joined by a space separator (or a single value containing
multiple space-separated scopes) or null for nonepublic BrowserClientRequestUrl setClientId(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 BrowserClientRequestUrl setState(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 AuthorizationRequestUrl
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||