public class OAuth2AuthenticationManager extends Object implements org.springframework.security.authentication.AuthenticationManager, InitializingBean
AuthenticationManager
for OAuth2 protected resources.Constructor and Description |
---|
OAuth2AuthenticationManager() |
Modifier and Type | Method and Description |
---|---|
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).
|
void |
setClientDetailsService(ClientDetailsService clientDetailsService) |
void |
setResourceId(String resourceId) |
void |
setTokenServices(ResourceServerTokenServices tokenServices) |
public void setResourceId(String resourceId)
public void setClientDetailsService(ClientDetailsService clientDetailsService)
public void setTokenServices(ResourceServerTokenServices tokenServices)
tokenServices
- the tokenServices to setpublic void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication) throws org.springframework.security.core.AuthenticationException
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).authenticate
in interface org.springframework.security.authentication.AuthenticationManager
authentication
- an authentication request containing an access token value as the principalOAuth2Authentication
org.springframework.security.core.AuthenticationException
AuthenticationManager.authenticate(org.springframework.security.core.Authentication)
Copyright © 2019. All rights reserved.