org.springframework.security.oauth2.provider.authentication
Class OAuth2AuthenticationManager

java.lang.Object
  extended by org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationManager
All Implemented Interfaces:
InitializingBean, org.springframework.security.authentication.AuthenticationManager

public class OAuth2AuthenticationManager
extends Object
implements org.springframework.security.authentication.AuthenticationManager, InitializingBean

An AuthenticationManager for OAuth2 protected resources.

Author:
Dave Syer

Constructor Summary
OAuth2AuthenticationManager()
           
 
Method Summary
 void afterPropertiesSet()
           
 org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication)
          Expects the incoming authentication request to have a principal value that is an access token value (e.g. from an authorization header) .Loads an authentication from the ResourceServerTokenServices and checks that the resource id is contained in the AuthorizationRequest (if one is specified).
 void setResourceId(String resourceId)
           
 void setTokenServices(ResourceServerTokenServices tokenServices)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OAuth2AuthenticationManager

public OAuth2AuthenticationManager()
Method Detail

setResourceId

public void setResourceId(String resourceId)

setTokenServices

public void setTokenServices(ResourceServerTokenServices tokenServices)
Parameters:
tokenServices - the tokenServices to set

afterPropertiesSet

public void afterPropertiesSet()
Specified by:
afterPropertiesSet in interface InitializingBean

authenticate

public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication)
                                                              throws org.springframework.security.core.AuthenticationException
Expects the incoming authentication request to have a principal value that is an access token value (e.g. from an authorization header) .Loads an authentication from the ResourceServerTokenServices and checks that the resource id is contained in the AuthorizationRequest (if one is specified). Also copies authentication details over from the input to the output (e.g. typically so that the access token value and request details can be reported later).

Specified by:
authenticate in interface org.springframework.security.authentication.AuthenticationManager
Parameters:
authentication - an authentication request containing an access token value as the principal
Returns:
an OAuth2Authentication
Throws:
org.springframework.security.core.AuthenticationException
See Also:
AuthenticationManager.authenticate(org.springframework.security.core.Authentication)


Copyright © 2012. All Rights Reserved.