public class ServerAuthenticationProvider extends Object implements org.springframework.security.authentication.AuthenticationProvider
AuthorizationMapper so that Authetication will create a current user
object in the Spring Framework with fully mapped roles/autorities in a
transparent manner.| Constructor and Description |
|---|
ServerAuthenticationProvider(org.springframework.security.authentication.AuthenticationProvider wrappedAuthenticationProvider)
Create a new ServerAuthenticationProvider using a
DefaultAuthorizationMapper |
ServerAuthenticationProvider(AuthorizationMapper authorizationMapper,
org.springframework.security.authentication.AuthenticationProvider wrappedAuthenticationProvider)
Create a new ServerAuthenticationProvider
|
ServerAuthenticationProvider(AuthorizationMapper authorizationMapper,
org.springframework.security.authentication.AuthenticationProvider wrappedAuthenticationProvider,
List<String> requiredRoles)
Create new ServerAuthenticationProvider
|
| Modifier and Type | Method and Description |
|---|---|
org.springframework.security.core.Authentication |
authenticate(org.springframework.security.core.Authentication authentication)
Authenticate the user using the wrapped authentication provider, map any
roles and check that the user has the required roles.
|
org.springframework.security.core.Authentication |
authenticate(org.springframework.security.core.Authentication authentication,
boolean checkRequired)
Authenticate the user using the wrapped authentication provider, map any
roles and optionally check that the user has the required roles.
|
void |
setRequiredRoles(List<String> requiredRoles)
Set the roles a user must have to be successfully authenticated
|
boolean |
supports(Class<?> authentication) |
public ServerAuthenticationProvider(org.springframework.security.authentication.AuthenticationProvider wrappedAuthenticationProvider)
DefaultAuthorizationMapperwrappedAuthenticationProvider - The wrapped AuthenticationProviderpublic ServerAuthenticationProvider(AuthorizationMapper authorizationMapper, org.springframework.security.authentication.AuthenticationProvider wrappedAuthenticationProvider)
authorizationMapper - The AuthorizationMapper to usewrappedAuthenticationProvider - The wrapped AuthenticationProviderpublic ServerAuthenticationProvider(AuthorizationMapper authorizationMapper, org.springframework.security.authentication.AuthenticationProvider wrappedAuthenticationProvider, List<String> requiredRoles)
authorizationMapper - The AuthorizationMapper to usewrappedAuthenticationProvider - The wrapped AuthenticationProviderrequiredRoles - A list of roles. If not empty the user must have one of these
roles to authenticatedpublic void setRequiredRoles(List<String> requiredRoles)
requiredRoles - the roles a user must have to be successfully authenticatedpublic org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication)
throws org.springframework.security.core.AuthenticationException
authenticate in interface org.springframework.security.authentication.AuthenticationProviderauthentication - The Authentication to validateorg.springframework.security.core.AuthenticationException - Can be thrown by the underlying wrapped authentication
providerpublic org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication,
boolean checkRequired)
throws org.springframework.security.core.AuthenticationException
authentication - The Authentication to validatecheckRequired - If true check the reuired roles if anyUsernamePasswordAuthenticationToken if the user was
authenticated otherwise null.org.springframework.security.core.AuthenticationException - Can be thrown by the underlying wrapped authentication
providerpublic boolean supports(Class<?> authentication)
supports in interface org.springframework.security.authentication.AuthenticationProviderCopyright © 2019 ADDC Infotech GmbH. All rights reserved.