@Component(value="cuba_TrustedClientService") public class TrustedClientServiceBean extends java.lang.Object implements TrustedClientService
Modifier and Type | Field and Description |
---|---|
protected AnonymousSessionHolder |
anonymousSessionHolder |
protected Authentication |
authentication |
protected Messages |
messages |
protected static java.lang.String |
MSG_PACK |
protected ServerConfig |
serverConfig |
protected TrustedLoginHandler |
trustedLoginHandler |
protected UserSessionsAPI |
userSessions |
NAME
Constructor and Description |
---|
TrustedClientServiceBean() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkTrustedClientCredentials(java.lang.String trustedClientPassword) |
UserSession |
findSession(java.lang.String trustedClientPassword,
java.util.UUID sessionId)
Get a UserSession from the cache of currently active sessions.
|
UserSession |
getAnonymousSession(java.lang.String trustedClientPassword)
Get anonymous user session from a trusted client.
|
UserSession |
getAnonymousSession(java.lang.String trustedClientPassword,
java.lang.String securityScope)
Get anonymous user session from a trusted client.
|
protected java.lang.String |
getInvalidCredentialsMessage(java.lang.String login,
java.util.Locale locale) |
UserSession |
getSystemSession(java.lang.String trustedClientPassword)
Get system user session from a trusted client.
|
void |
healthCheck()
Do nothing.
|
protected static final java.lang.String MSG_PACK
@Inject protected TrustedLoginHandler trustedLoginHandler
@Inject protected ServerConfig serverConfig
@Inject protected Messages messages
@Inject protected Authentication authentication
@Inject protected UserSessionsAPI userSessions
@Inject protected AnonymousSessionHolder anonymousSessionHolder
@Nonnull public UserSession getSystemSession(java.lang.String trustedClientPassword) throws LoginException
TrustedClientService
AuthenticationService.logout()
for obtained user session.
It is cached on middleware for multiple clients. getSystemSession
in interface TrustedClientService
trustedClientPassword
- trusted client passwordLoginException
- if passed invalid trusted client password@Nonnull public UserSession getAnonymousSession(java.lang.String trustedClientPassword) throws LoginException
TrustedClientService
Method works like the TrustedClientService.getAnonymousSession(String, String)
using the default scope name.
getAnonymousSession
in interface TrustedClientService
trustedClientPassword
- trusted client passwordLoginException
- if passed invalid trusted client password@Nonnull public UserSession getAnonymousSession(java.lang.String trustedClientPassword, java.lang.String securityScope) throws LoginException
TrustedClientService
getAnonymousSession
in interface TrustedClientService
trustedClientPassword
- trusted client passwordsecurityScope
- security scope nameLoginException
- if passed invalid trusted client password@Nullable public UserSession findSession(java.lang.String trustedClientPassword, java.util.UUID sessionId) throws LoginException
TrustedClientService
findSession
in interface TrustedClientService
trustedClientPassword
- trusted client passwordsessionId
- session idLoginException
- if passed invalid trusted client passwordprotected java.lang.String getInvalidCredentialsMessage(java.lang.String login, java.util.Locale locale)
protected void checkTrustedClientCredentials(java.lang.String trustedClientPassword) throws LoginException
LoginException
public void healthCheck()
TrustedClientService
healthCheck
in interface TrustedClientService