public class SessionUtils extends Object
Modifier and Type | Field and Description |
---|---|
static short |
QUERY
The QUERY encoding scheme
|
static short |
SEMICOLON
The SEMICOLON encoding scheme
|
static short |
SLASH
The SLASH encoding scheme
|
Constructor and Description |
---|
SessionUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
checkPermissionToSetProperty(SSOToken clientToken,
String key,
String value)
Helper method to check if client has taken permission to
set value to it.
|
static SSOToken |
getAdminToken()
Helper method to get admin token.
|
static InetAddress |
getClientAddress(javax.servlet.http.HttpServletRequest servletRequest)
Returns the remote IP address of the client
|
static String |
getDecrypted(String encrypted) |
static String |
getEncrypted(String clear) |
static String |
getEncryptedStorageKey(SessionID clear) |
static String |
getSessionId(javax.servlet.http.HttpServletRequest request)
Returns a SessionID string based on a HttpServletRequest object or null
if session id is not present or there was an error.
|
static boolean |
isAdmin(SSOToken admToken,
SSOToken usrToken)
Helper method to compare if the user token passed is same as admin
token.
|
static boolean |
isTrustedSource(InetAddress source)
Returns the remote IP address of the client is a trusted source
|
public static final short QUERY
public static final short SLASH
public static final short SEMICOLON
public static String getSessionId(javax.servlet.http.HttpServletRequest request)
request
- The HttpServletRequest object which contains the session
string.public static InetAddress getClientAddress(javax.servlet.http.HttpServletRequest servletRequest) throws Exception
servletRequest
- The HttpServletRequest object which contains the
session string.Exception
public static boolean isTrustedSource(InetAddress source) throws SessionException
source
- the InetAddress of the remote clienttrue
if is a trusted source.false> otherwise
Exception
SessionException
public static String getEncryptedStorageKey(SessionID clear) throws Exception
Exception
public static SSOToken getAdminToken() throws SSOException
SSOException
public static boolean isAdmin(SSOToken admToken, SSOToken usrToken)
admToken
- Admin Single Sign-On token.usrToken
- User Single Sign-On token to compare against admin
Single Sign-On token.true
if they both are same.public static void checkPermissionToSetProperty(SSOToken clientToken, String key, String value) throws SessionException
clientToken
- Token of the client setting protected property.key
- Property keyvalue
- Property value.SessionException
- if the key is protected property.Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.