org.springframework.security.oauth2.provider
类 AuthorizationRequest

java.lang.Object
  继承者 org.springframework.security.oauth2.provider.AuthorizationRequest

public class AuthorizationRequest
extends Object

Base class representing an OAuth2 Authorization Request. HTTP request parameters are stored in the parameters map, and any processing the server makes throughout the lifecycle of a request are stored on individual properties. The original request parameters will remain available through the parameters map. For convenience, constants are defined in order to get at those original values. However, the parameters map is unmodifiable so that processing cannot drop the original values.

作者:
Ryan Heaton, Dave Syer, Amanda Anganes

字段摘要
protected  String clientId
          Resolved client ID.
protected  Map<String,String> requestParameters
          Map of parameters passed in to the Authorization Endpoint or Token Endpoint, preserved unchanged from the original request.
protected  Set<String> scope
          Resolved scope set, initialized (by the OAuth2RequestFactory) with the scopes originally requested.
 
构造方法摘要
AuthorizationRequest()
          Default constructor.
AuthorizationRequest(Map<String,String> authorizationParameters, Map<String,String> approvalParameters, String clientId, Set<String> scope, Set<String> resourceIds, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities, boolean approved, String state, String redirectUri, Set<String> responseTypes)
          Full constructor.
AuthorizationRequest(String clientId, Collection<String> scopes)
          Convenience constructor for unit tests, where client ID and scope are often the only needed fields.
 
方法摘要
 OAuth2Request createOAuth2Request()
           
 boolean equals(Object obj)
           
 Map<String,String> getApprovalParameters()
           
 Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities()
           
 String getClientId()
           
 Map<String,Serializable> getExtensions()
           
 String getRedirectUri()
           
 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> getResourceIds()
           
 Set<String> getResponseTypes()
           
 Set<String> getScope()
           
 String getState()
           
 int hashCode()
           
 boolean isApproved()
           
 void setApprovalParameters(Map<String,String> approvalParameters)
           
 void setApproved(boolean approved)
           
 void setAuthorities(Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
           
 void setClientId(String clientId)
           
 void setExtensions(Map<String,Serializable> extensions)
           
 void setRedirectUri(String redirectUri)
           
 void setRequestParameters(Map<String,String> requestParameters)
           
 void setResourceIds(Set<String> resourceIds)
           
 void setResourceIdsAndAuthoritiesFromClientDetails(ClientDetails clientDetails)
          Convenience method to set resourceIds and authorities on this request by inheriting from a ClientDetails object.
 void setResponseTypes(Set<String> responseTypes)
           
 void setScope(Collection<String> scope)
           
 void setState(String state)
           
 
从类 java.lang.Object 继承的方法
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

clientId

protected String clientId
Resolved client ID. This may be present in the original request parameters, or in some cases may be inferred by a processing class and inserted here.


scope

protected Set<String> scope
Resolved scope set, initialized (by the OAuth2RequestFactory) with the scopes originally requested. Further processing and user interaction may alter the set of scopes that is finally granted and stored when the request processing is complete.


requestParameters

protected Map<String,String> requestParameters
Map of parameters passed in to the Authorization Endpoint or Token Endpoint, preserved unchanged from the original request. This map should not be modified after initialization. In general, classes should not retrieve values from this map directly, and should instead use the individual members on this class. The OAuth2RequestFactory is responsible for initializing all members of this class, usually by parsing the values inside the requestParmaeters map.

构造方法详细信息

AuthorizationRequest

public AuthorizationRequest()
Default constructor.


AuthorizationRequest

public AuthorizationRequest(Map<String,String> authorizationParameters,
                            Map<String,String> approvalParameters,
                            String clientId,
                            Set<String> scope,
                            Set<String> resourceIds,
                            Collection<? extends org.springframework.security.core.GrantedAuthority> authorities,
                            boolean approved,
                            String state,
                            String redirectUri,
                            Set<String> responseTypes)
Full constructor.


AuthorizationRequest

public AuthorizationRequest(String clientId,
                            Collection<String> scopes)
Convenience constructor for unit tests, where client ID and scope are often the only needed fields.

参数:
clientId -
scopes -
方法详细信息

createOAuth2Request

public OAuth2Request createOAuth2Request()

setResourceIdsAndAuthoritiesFromClientDetails

public void setResourceIdsAndAuthoritiesFromClientDetails(ClientDetails clientDetails)
Convenience method to set resourceIds and authorities on this request by inheriting from a ClientDetails object.

参数:
clientDetails -

getApprovalParameters

public Map<String,String> getApprovalParameters()

setApprovalParameters

public void setApprovalParameters(Map<String,String> approvalParameters)

getState

public String getState()

setState

public void setState(String state)

getResponseTypes

public Set<String> getResponseTypes()

setResponseTypes

public void setResponseTypes(Set<String> responseTypes)

setRedirectUri

public void setRedirectUri(String redirectUri)

setApproved

public void setApproved(boolean approved)

setAuthorities

public void setAuthorities(Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)

getExtensions

public Map<String,Serializable> getExtensions()
返回:
the extensions

setExtensions

public void setExtensions(Map<String,Serializable> extensions)

setResourceIds

public void setResourceIds(Set<String> resourceIds)

setClientId

public void setClientId(String clientId)

setScope

public void setScope(Collection<String> scope)

setRequestParameters

public void setRequestParameters(Map<String,String> requestParameters)

getResourceIds

public Set<String> getResourceIds()
返回:
the resourceIds

getAuthorities

public Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities()
返回:
the authorities

isApproved

public boolean isApproved()
返回:
the approved

getRedirectUri

public String getRedirectUri()
返回:
the redirectUri

hashCode

public int hashCode()

equals

public boolean equals(Object obj)

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.

返回:
the original, unchanged set of request parameters


Copyright © 2013. All rights reserved.