org.springframework.security.oauth2.provider.authentication
Class OAuth2AuthenticationManager
java.lang.Object
org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationManager
- All Implemented Interfaces:
- org.springframework.beans.factory.InitializingBean, org.springframework.security.authentication.AuthenticationManager
public class OAuth2AuthenticationManager
- extends Object
- implements org.springframework.security.authentication.AuthenticationManager, org.springframework.beans.factory.InitializingBean
An AuthenticationManager for OAuth2 protected resources.
- Author:
- Dave Syer
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OAuth2AuthenticationManager
public OAuth2AuthenticationManager()
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 org.springframework.beans.factory.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 © 2013. All rights reserved.