public class GoogleBrowserClientRequestUrl
extends com.google.api.client.auth.oauth2.BrowserClientRequestUrl
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 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.
com.google.api.client.util.GenericData.FlagsAbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
GoogleBrowserClientRequestUrl(GoogleClientSecrets clientSecrets,
String redirectUri,
Collection<String> scopes) |
GoogleBrowserClientRequestUrl(String clientId,
String redirectUri,
Collection<String> scopes) |
| Modifier and Type | Method and Description |
|---|---|
GoogleBrowserClientRequestUrl |
clone() |
String |
getApprovalPrompt()
Returns the approval prompt behavior (
"auto" to request auto-approval or
"force" to force the approval UI to show) or null for the default behavior of
"auto". |
GoogleBrowserClientRequestUrl |
set(String fieldName,
Object value) |
GoogleBrowserClientRequestUrl |
setApprovalPrompt(String approvalPrompt)
Sets the approval prompt behavior (
"auto" to request auto-approval or "force"
to force the approval UI to show) or null for the default behavior of "auto". |
GoogleBrowserClientRequestUrl |
setClientId(String clientId) |
GoogleBrowserClientRequestUrl |
setRedirectUri(String redirectUri) |
GoogleBrowserClientRequestUrl |
setResponseTypes(Collection<String> responseTypes) |
GoogleBrowserClientRequestUrl |
setScopes(Collection<String> scopes) |
GoogleBrowserClientRequestUrl |
setState(String state) |
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 GoogleBrowserClientRequestUrl(String clientId, String redirectUri, Collection<String> scopes)
clientId - client identifierredirectUri - URI that the authorization server directs the resource owner's user-agent
back to the client after a successful authorization grantscopes - scopes (see setScopes(Collection))public GoogleBrowserClientRequestUrl(GoogleClientSecrets clientSecrets, String redirectUri, Collection<String> scopes)
clientSecrets - OAuth 2.0 client secrets JSON model as specified in
client_secrets.json file formatredirectUri - URI that the authorization server directs the resource owner's user-agent
back to the client after a successful authorization grantscopes - scopes (see setScopes(Collection))public final String getApprovalPrompt()
"auto" to request auto-approval or
"force" to force the approval UI to show) or null for the default behavior of
"auto".public GoogleBrowserClientRequestUrl setApprovalPrompt(String approvalPrompt)
"auto" to request auto-approval or "force"
to force the approval UI to show) or null for the default behavior of "auto".
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public GoogleBrowserClientRequestUrl setResponseTypes(Collection<String> responseTypes)
setResponseTypes in class com.google.api.client.auth.oauth2.BrowserClientRequestUrlpublic GoogleBrowserClientRequestUrl setRedirectUri(String redirectUri)
setRedirectUri in class com.google.api.client.auth.oauth2.BrowserClientRequestUrlpublic GoogleBrowserClientRequestUrl setScopes(Collection<String> scopes)
setScopes in class com.google.api.client.auth.oauth2.BrowserClientRequestUrlpublic GoogleBrowserClientRequestUrl setClientId(String clientId)
setClientId in class com.google.api.client.auth.oauth2.BrowserClientRequestUrlpublic GoogleBrowserClientRequestUrl setState(String state)
setState in class com.google.api.client.auth.oauth2.BrowserClientRequestUrlpublic GoogleBrowserClientRequestUrl set(String fieldName, Object value)
set in class com.google.api.client.auth.oauth2.BrowserClientRequestUrlpublic GoogleBrowserClientRequestUrl clone()
clone in class com.google.api.client.auth.oauth2.BrowserClientRequestUrlCopyright © 2010-2016 Google. All Rights Reserved.