com.google.api.client.auth.oauth2
Class WebServerAuthorizationRequestUrl

java.lang.Object
  extended by java.util.AbstractMap<String,Object>
      extended by com.google.api.client.util.GenericData
          extended by com.google.api.client.http.GenericUrl
              extended by com.google.api.client.auth.oauth2.AbstractAuthorizationRequestUrl
                  extended by com.google.api.client.auth.oauth2.WebServerAuthorizationRequestUrl
All Implemented Interfaces:
Cloneable, Map<String,Object>

public class WebServerAuthorizationRequestUrl
extends AbstractAuthorizationRequestUrl

OAuth 2.0 Web Server Flow: URL builder for an authorization web page to allow the end user to authorize the application to access their protected resources.

The most commonly-set fields are AbstractAuthorizationRequestUrl.clientId, AbstractAuthorizationRequestUrl.redirectUri, and AbstractAuthorizationRequestUrl.scope. After the end-user grants or denies the request, they will be redirected to the AbstractAuthorizationRequestUrl.redirectUri with query parameters set by the authorization server. Use WebServerAuthorizationResponse to parse the redirect URL.

Sample usage:

 @Override
 public void doGet(HttpServletRequest request, HttpServletResponse response)
     throws IOException {
   WebServerAuthorizationUrl builder
       = new WebServerAuthorizationUrl(BASE_AUTHORIZATION_URL);
   builder.clientId = CLIENT_ID;
   builder.redirectUri = REDIRECT_URL;
   builder.scope = SCOPE;
   response.sendRedirect(authorizeUrl.build());
 }
 

Since:
1.0
Author:
Yaniv Inbar

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>
 
Field Summary
 
Fields inherited from class com.google.api.client.auth.oauth2.AbstractAuthorizationRequestUrl
clientId, redirectUri, scope, state, type
 
Fields inherited from class com.google.api.client.http.GenericUrl
fragment, host, path, pathParts, port, scheme
 
Fields inherited from class com.google.api.client.util.GenericData
unknownFields
 
Constructor Summary
WebServerAuthorizationRequestUrl(String encodedAuthorizationServerUrl)
           
 
Method Summary
 
Methods inherited from class com.google.api.client.http.GenericUrl
appendRawPath, build, clone, equals, getAll, getFirst, getRawPath, hashCode, setRawPath, toPathParts, toString
 
Methods inherited from class com.google.api.client.util.GenericData
entrySet, get, put, putAll, remove, set, size
 
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, isEmpty, keySet, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WebServerAuthorizationRequestUrl

public WebServerAuthorizationRequestUrl(String encodedAuthorizationServerUrl)


Copyright © 2010 Google. All Rights Reserved.