Package com.skava.auth.helper
Class AuthSessionHandler
java.lang.Object
com.skava.auth.helper.AuthSessionHandler
This class used to handle the user session operations like put token to the cache, get token from the cache,
remove the session, etc.
- Version:
- $Id: $Id
- Author:
- Infosys Equinox
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.core.Authentication
getAuthentication
(String sessionid) This method return the authorization token from cache by using identifier of the session.This method return the currently logged in client.This method return the currently logged in user.void
putToken
(String sessionId, String refreshToken, com.skava.core.auth.AuthenticationToken authToken, com.skava.core.auth.AuthGrantedAuthority authGrantedAuthority, boolean isGuest, Long authExpiryTime) This method put the session details of the user to session cache.void
removeSession
(String sessionId) This method remove the session details of the user from session cache by session identifier.
-
Constructor Details
-
AuthSessionHandler
public AuthSessionHandler()Default constructor of the class.
-
-
Method Details
-
getAuthentication
This method return the authorization token from cache by using identifier of the session.- Parameters:
sessionid
- aString
object. a identifier of the session given to user after establishing the session with system.- Returns:
- a
Authentication
object. a authorized token alloted for the given session id with session id from the cache.
-
getLoggedInUserId
This method return the currently logged in user.- Returns:
- a
Long
object. a identifier of the user from the authorization token.
-
getLoggedInClientId
This method return the currently logged in client.- Returns:
- a
String
object. a identifier of the client from the authorization token.
-
putToken
public void putToken(String sessionId, String refreshToken, com.skava.core.auth.AuthenticationToken authToken, com.skava.core.auth.AuthGrantedAuthority authGrantedAuthority, boolean isGuest, Long authExpiryTime) This method put the session details of the user to session cache.- Parameters:
refreshToken
- refreshTokensessionId
- sessionIdauthToken
- aAuthenticationToken
object. an alloted token to the session with session id for caching.authGrantedAuthority
- aAuthGrantedAuthority
object.isGuest
- a boolean value denoting whether the session is for guest user or not.authExpiryTime
- aLong
object. an expire time of authorization token.
-
removeSession
This method remove the session details of the user from session cache by session identifier.- Parameters:
sessionId
- to remove a session from cache
-