org.springframework.security.oauth2.provider.approval
Class TokenServicesUserApprovalHandler
java.lang.Object
org.springframework.security.oauth2.provider.approval.TokenServicesUserApprovalHandler
- All Implemented Interfaces:
- org.springframework.beans.factory.InitializingBean, UserApprovalHandler
public class TokenServicesUserApprovalHandler
- extends Object
- implements UserApprovalHandler, org.springframework.beans.factory.InitializingBean
A user approval handler that remembers approval decisions by consulting existing tokens.
- Author:
- Dave Syer
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TokenServicesUserApprovalHandler
public TokenServicesUserApprovalHandler()
setApprovalParameter
public void setApprovalParameter(String approvalParameter)
- Parameters:
approvalParameter - the approvalParameter to set
setTokenServices
public void setTokenServices(AuthorizationServerTokenServices tokenServices)
- Parameters:
tokenServices - the token services to set
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
updateBeforeApproval
public AuthorizationRequest updateBeforeApproval(AuthorizationRequest authorizationRequest,
org.springframework.security.core.Authentication userAuthentication)
- Description copied from interface:
UserApprovalHandler
Provides an opportunity to update the authorization request before it is checked for approval in cases where the
incoming approval parameters contain richer information than just true/false (e.g. some scopes are approved, and
others are rejected), implementations may need to be able to modify the AuthorizationRequest before a
token is generated from it.
- Specified by:
updateBeforeApproval in interface UserApprovalHandler
- Parameters:
authorizationRequest - the authorization request.userAuthentication - TODO
- Returns:
- a new instance or the same one if no changes are required
isApproved
public boolean isApproved(AuthorizationRequest authorizationRequest,
org.springframework.security.core.Authentication userAuthentication)
- Basic implementation just requires the authorization request to be explicitly approved and the user to be
authenticated.
- Specified by:
isApproved in interface UserApprovalHandler
- Parameters:
authorizationRequest - The authorization request.userAuthentication - the current user authentication
- Returns:
- Whether the specified request has been approved by the current user.
Copyright © 2012. All Rights Reserved.