org.springframework.security.oauth2.provider.approval
Class TokenServicesUserApprovalHandler

java.lang.Object
  extended by org.springframework.security.oauth2.provider.approval.TokenServicesUserApprovalHandler
All Implemented Interfaces:
InitializingBean, UserApprovalHandler
Direct Known Subclasses:
SparklrUserApprovalHandler

public class TokenServicesUserApprovalHandler
extends Object
implements UserApprovalHandler, InitializingBean

A user approval handler that remembers approval decisions by consulting existing tokens.

Author:
Dave Syer

Constructor Summary
TokenServicesUserApprovalHandler()
           
 
Method Summary
 void afterPropertiesSet()
           
 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.
 void setApprovalParameter(String approvalParameter)
           
 void setTokenServices(AuthorizationServerTokenServices tokenServices)
           
 AuthorizationRequest updateBeforeApproval(AuthorizationRequest authorizationRequest, org.springframework.security.core.Authentication userAuthentication)
           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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokenServicesUserApprovalHandler

public TokenServicesUserApprovalHandler()
Method Detail

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 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.