@Component(value="core_SystemAuthenticator") public class SystemAuthenticatorImpl extends SystemAuthenticatorSupport implements SystemAuthenticator
SystemAuthenticatorSupport.NullAuthentication
SystemAuthenticator.AuthenticatedOperation<T>
Modifier and Type | Field and Description |
---|---|
protected org.springframework.security.authentication.AuthenticationManager |
authenticationManager |
NULL_AUTHENTICATION, threadLocalStack
Constructor and Description |
---|
SystemAuthenticatorImpl() |
Modifier and Type | Method and Description |
---|---|
org.springframework.security.core.Authentication |
begin()
Authenticate as the 'system' user.
|
org.springframework.security.core.Authentication |
begin(java.lang.String login)
Begins an authenticated code block.
|
protected void |
beginServerSessionOnStartup(org.springframework.context.event.ContextRefreshedEvent event) |
void |
end()
End of an authenticated code block.
|
protected void |
endServerSessionOnStartup(org.springframework.context.event.ContextRefreshedEvent event) |
<T> T |
withSystem(SystemAuthenticator.AuthenticatedOperation<T> operation)
Execute code as the 'system' user.
|
<T> T |
withUser(java.lang.String login,
SystemAuthenticator.AuthenticatedOperation<T> operation)
Execute code on behalf of the specified user.
|
pollAuthentication, pushAuthentication
@Autowired(required=false) protected org.springframework.security.authentication.AuthenticationManager authenticationManager
@EventListener @Order(value=105) protected void beginServerSessionOnStartup(org.springframework.context.event.ContextRefreshedEvent event)
@EventListener @Order(value=995) protected void endServerSessionOnStartup(org.springframework.context.event.ContextRefreshedEvent event)
public org.springframework.security.core.Authentication begin(@Nullable java.lang.String login)
SystemAuthenticator
SystemAuthenticator.end()
.
Subsequent SystemAuthenticator.end()
method must be called in "finally" section.begin
in interface SystemAuthenticator
login
- user login. If null, authenticates as the 'system' user.Authentication
objectpublic org.springframework.security.core.Authentication begin()
SystemAuthenticator
SystemAuthenticator.begin(String)
with null parameter.begin
in interface SystemAuthenticator
public void end()
SystemAuthenticator
end
in interface SystemAuthenticator
public <T> T withUser(@Nullable java.lang.String login, SystemAuthenticator.AuthenticatedOperation<T> operation)
SystemAuthenticator
withUser
in interface SystemAuthenticator
login
- user login. If null, the system session is used.operation
- code to executepublic <T> T withSystem(SystemAuthenticator.AuthenticatedOperation<T> operation)
SystemAuthenticator
withSystem
in interface SystemAuthenticator
operation
- code to execute