org.springframework.security.oauth2.provider
Class TokenRequest

java.lang.Object
  extended by org.springframework.security.oauth2.provider.TokenRequest
All Implemented Interfaces:
Serializable

public class TokenRequest
extends Object

Represents an OAuth2 token request, made at the TokenEndpoint. The requestParameters map should contain the original, unmodified parameters from the original OAuth2 request. In the implicit flow, a token is requested through the AuthorizationEndpoint directly, and in that case the AuthorizationRequest is converted into a TokenRequest for processing through the token granting chain.

Author:
Amanda Anganes, Dave Syer
See Also:
Serialized Form

Constructor Summary
protected TokenRequest()
          Default constructor
  TokenRequest(Map<String,String> requestParameters, String clientId, Collection<String> scope, String grantType)
          Full constructor.
 
Method Summary
 OAuth2Request createOAuth2Request(ClientDetails client)
           
 boolean equals(Object obj)
           
 String getClientId()
           
 String getGrantType()
           
 Map<String,String> getRequestParameters()
          Warning: most clients should use the individual properties of this class, such as {getScope() or { getClientId(), rather than retrieving values from this map.
 Set<String> getScope()
           
 int hashCode()
           
 void setClientId(String clientId)
           
 void setGrantType(String grantType)
           
 void setRequestParameters(Map<String,String> requestParameters)
          Set the Request Parameters on this authorization request, which represent the original request parameters and should never be changed during processing.
 void setScope(Collection<String> scope)
          Set the scope value.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokenRequest

protected TokenRequest()
Default constructor


TokenRequest

public TokenRequest(Map<String,String> requestParameters,
                    String clientId,
                    Collection<String> scope,
                    String grantType)
Full constructor. Sets this TokenRequest's requestParameters map to an unmodifiable version of the one provided.

Parameters:
requestParameters -
clientId -
scope -
grantType -
Method Detail

getGrantType

public String getGrantType()

setGrantType

public void setGrantType(String grantType)

setClientId

public void setClientId(String clientId)

setScope

public void setScope(Collection<String> scope)
Set the scope value. If the collection contains only a single scope value, this method will parse that value into a collection using OAuth2Utils.parseParameterList.

Parameters:
scope -
See Also:
AuthorizationRequest.setScope

setRequestParameters

public void setRequestParameters(Map<String,String> requestParameters)
Set the Request Parameters on this authorization request, which represent the original request parameters and should never be changed during processing. The map passed in is wrapped in an unmodifiable map instance.

Parameters:
requestParameters -
See Also:
AuthorizationRequest.setRequestParameters

createOAuth2Request

public OAuth2Request createOAuth2Request(ClientDetails client)

getClientId

public String getClientId()

getScope

public Set<String> getScope()

getRequestParameters

public Map<String,String> getRequestParameters()
Warning: most clients should use the individual properties of this class, such as {getScope() or { getClientId(), rather than retrieving values from this map.

Returns:
the original, unchanged set of request parameters

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2013. All rights reserved.