Package io.jmix.core.security
Interface CurrentAuthentication
- All Known Implementing Classes:
CurrentAuthenticationImpl
public interface CurrentAuthentication
Provides information about the currently authenticated user.
-
Method Details
-
getAuthentication
org.springframework.security.core.Authentication getAuthentication()Returns current authentication object.- Throws:
IllegalStateException
- if Authentication is not set toSecurityContext
-
getUser
org.springframework.security.core.userdetails.UserDetails getUser()Returns the authenticated user. If you need to get the user substitution information use theCurrentUserSubstitution
.- Returns:
- currently authenticated user
- Throws:
RuntimeException
- if Authentication is not set toSecurityContext
or user information cannot be extracted from current authentication
-
getLocale
Locale getLocale()- Returns:
- locale of the current authentication or default locale if current authentication doesn't contain locale information
- Throws:
RuntimeException
- if Authentication is not set toSecurityContext
-
getTimeZone
TimeZone getTimeZone()- Returns:
- time zone of the current authentication or default time zone if current authentication doesn't contain time zone information
- Throws:
RuntimeException
- if Authentication is not set toSecurityContext
-
isSet
boolean isSet()- Returns:
- true if authentication is set to
SecurityContext
-