Package io.jmix.core.security.impl
Class SystemAuthenticatorImpl
java.lang.Object
io.jmix.core.security.impl.SystemAuthenticatorSupport
io.jmix.core.security.impl.SystemAuthenticatorImpl
- All Implemented Interfaces:
- SystemAuthenticator
@Component("core_SystemAuthenticator")
public class SystemAuthenticatorImpl
extends SystemAuthenticatorSupport
implements SystemAuthenticator
- 
Nested Class SummaryNested classes/interfaces inherited from class io.jmix.core.security.impl.SystemAuthenticatorSupportSystemAuthenticatorSupport.NullAuthenticationNested classes/interfaces inherited from interface io.jmix.core.security.SystemAuthenticatorSystemAuthenticator.AuthenticatedOperation<T>
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected org.springframework.security.authentication.AuthenticationManagerFields inherited from class io.jmix.core.security.impl.SystemAuthenticatorSupportNULL_AUTHENTICATION, threadLocalStack
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionorg.springframework.security.core.Authenticationbegin()Authenticate as the 'system' user.org.springframework.security.core.AuthenticationBegins an authenticated code block.protected voidbeginServerSessionOnStartup(org.springframework.context.event.ContextRefreshedEvent event) voidend()End of an authenticated code block.protected voidendServerSessionOnStartup(org.springframework.context.event.ContextRefreshedEvent event) voidrunWithSystem(Runnable operation) Execute code as the 'system' user.voidrunWithUser(String login, Runnable operation) Execute code on behalf of the specified user.<T> TwithSystem(SystemAuthenticator.AuthenticatedOperation<T> operation) Execute code as the 'system' user and return a result.<T> TwithUser(String login, SystemAuthenticator.AuthenticatedOperation<T> operation) Execute code on behalf of the specified user and return a result.Methods inherited from class io.jmix.core.security.impl.SystemAuthenticatorSupportpollAuthentication, pushAuthentication
- 
Field Details- 
authenticationManager@Autowired(required=false) protected org.springframework.security.authentication.AuthenticationManager authenticationManager
 
- 
- 
Constructor Details- 
SystemAuthenticatorImplpublic SystemAuthenticatorImpl()
 
- 
- 
Method Details- 
beginServerSessionOnStartup@EventListener @Order(105) protected void beginServerSessionOnStartup(org.springframework.context.event.ContextRefreshedEvent event) 
- 
endServerSessionOnStartup@EventListener @Order(995) protected void endServerSessionOnStartup(org.springframework.context.event.ContextRefreshedEvent event) 
- 
beginDescription copied from interface:SystemAuthenticatorBegins an authenticated code block.
 Saves the current thread session on a stack to get it back onSystemAuthenticator.end(). SubsequentSystemAuthenticator.end()method must be called in "finally" section.- Specified by:
- beginin interface- SystemAuthenticator
- Parameters:
- login- user login. If null, authenticates as the 'system' user.
- Returns:
- populated Authenticationobject
 
- 
beginpublic org.springframework.security.core.Authentication begin()Description copied from interface:SystemAuthenticatorAuthenticate as the 'system' user.
 Same asSystemAuthenticator.begin(String)with null parameter.- Specified by:
- beginin interface- SystemAuthenticator
 
- 
endpublic void end()Description copied from interface:SystemAuthenticatorEnd of an authenticated code block.
 The previous session (or null) is set to security context. Must be called in "finally" section of a try/finally block.- Specified by:
- endin interface- SystemAuthenticator
 
- 
withUserpublic <T> T withUser(@Nullable String login, SystemAuthenticator.AuthenticatedOperation<T> operation) Description copied from interface:SystemAuthenticatorExecute code on behalf of the specified user and return a result.- Specified by:
- withUserin interface- SystemAuthenticator
- Parameters:
- login- user login. If null, the system session is used.
- operation- code to execute
- Returns:
- result of the execution
 
- 
runWithUserDescription copied from interface:SystemAuthenticatorExecute code on behalf of the specified user.- Specified by:
- runWithUserin interface- SystemAuthenticator
- Parameters:
- login- user login. If null, the system session is used.
- operation- code to execute
 
- 
withSystemDescription copied from interface:SystemAuthenticatorExecute code as the 'system' user and return a result.- Specified by:
- withSystemin interface- SystemAuthenticator
- Parameters:
- operation- code to execute
- Returns:
- result of the execution
 
- 
runWithSystemDescription copied from interface:SystemAuthenticatorExecute code as the 'system' user.- Specified by:
- runWithSystemin interface- SystemAuthenticator
- Parameters:
- operation- code to execute
 
 
-