public class AuthorizationRequest extends Object implements Serializable
OAuth2Request
class.
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.
This class is Serializable
in order to support storage of the
authorization request as a SessionAttributes
member while the end
user through the authorization process (which may span several page
requests).Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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)
Set the Request Parameters on this authorization request, which represent
the original request parameters and should never be changed during
processing.
|
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)
Set the scope value.
|
void |
setState(String state) |
public 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)
public AuthorizationRequest(String clientId, Collection<String> scopes)
clientId
- scopes
- public OAuth2Request createOAuth2Request()
public void setResourceIdsAndAuthoritiesFromClientDetails(ClientDetails clientDetails)
clientDetails
- public String getState()
public void setState(String state)
public void setRedirectUri(String redirectUri)
public void setApproved(boolean approved)
public void setAuthorities(Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
public Map<String,Serializable> getExtensions()
public void setExtensions(Map<String,Serializable> extensions)
public void setClientId(String clientId)
public void setScope(Collection<String> scope)
OAuth2Utils.parseParameterList(java.lang.String)
.scope
- TokenRequest.setScope(java.util.Collection<java.lang.String>)
public void setRequestParameters(Map<String,String> requestParameters)
requestParameters
- TokenRequest.setRequestParameters(java.util.Map<java.lang.String, java.lang.String>)
public Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities()
public boolean isApproved()
public String getRedirectUri()
public int hashCode()
public boolean equals(Object obj)
public String getClientId()
public Map<String,String> getRequestParameters()
getScope()
or { getClientId()
, rather than
retrieving values from this map.Copyright © 2019. All rights reserved.