Package io.jans.as.server.service
Class CookieService
- java.lang.Object
-
- io.jans.as.server.service.CookieService
-
@RequestScoped public class CookieService extends java.lang.Object
- Author:
- Yuriy Zabrovarnyy
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CONSENT_SESSION_ID_COOKIE_NAME
static java.lang.String
CURRENT_SESSIONS_COOKIE_NAME
static java.lang.String
OP_BROWSER_STATE
static java.lang.String
SESSION_ID_COOKIE_NAME
-
Constructor Summary
Constructors Constructor Description CookieService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCurrentSessionCookie(SessionId sessionId, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse httpResponse)
protected void
createCookie(java.lang.String header, javax.servlet.http.HttpServletResponse httpResponse)
void
createCookieWithState(java.lang.String sessionId, java.lang.String sessionState, java.lang.String opbs, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse httpResponse, java.lang.String cookieName)
void
createOPBrowserStateCookie(java.lang.String opbs, javax.servlet.http.HttpServletResponse httpResponse)
void
createSessionIdCookie(SessionId sessionId, boolean isUma)
void
createSessionIdCookie(SessionId sessionId, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse httpResponse, boolean isUma)
void
createSessionStateCookie(java.lang.String sessionState, javax.servlet.http.HttpServletResponse httpResponse)
void
creatRpOriginIdCookie(java.lang.String rpOriginId)
void
creatRpOriginIdCookie(java.lang.String rpOriginId, javax.servlet.http.HttpServletResponse httpResponse)
java.lang.String
getConsentSessionIdFromCookie(javax.servlet.http.HttpServletRequest request)
java.util.Set<java.lang.String>
getCurrentSessions()
java.util.Set<java.lang.String>
getCurrentSessions(javax.servlet.http.HttpServletRequest request)
java.lang.String
getRpOriginIdCookie()
java.lang.String
getSessionIdFromCookie()
java.lang.String
getSessionIdFromCookie(javax.servlet.http.HttpServletRequest request)
java.lang.String
getSessionStateFromCookie(javax.servlet.http.HttpServletRequest request)
java.lang.String
getUmaSessionIdFromCookie(javax.servlet.http.HttpServletRequest request)
java.lang.String
getValueFromCookie(java.lang.String cookieName)
java.lang.String
getValueFromCookie(javax.servlet.http.HttpServletRequest request, java.lang.String cookieName)
void
removeConsentSessionIdCookie(javax.servlet.http.HttpServletResponse httpResponse)
void
removeCookie(java.lang.String cookieName, javax.servlet.http.HttpServletResponse httpResponse)
void
removeOPBrowserStateCookie(javax.servlet.http.HttpServletResponse httpResponse)
void
removeSessionIdCookie(javax.servlet.http.HttpServletResponse httpResponse)
void
removeUmaSessionIdCookie(javax.servlet.http.HttpServletResponse httpResponse)
-
-
-
Field Detail
-
OP_BROWSER_STATE
public static final java.lang.String OP_BROWSER_STATE
- See Also:
- Constant Field Values
-
SESSION_ID_COOKIE_NAME
public static final java.lang.String SESSION_ID_COOKIE_NAME
- See Also:
- Constant Field Values
-
CONSENT_SESSION_ID_COOKIE_NAME
public static final java.lang.String CONSENT_SESSION_ID_COOKIE_NAME
- See Also:
- Constant Field Values
-
CURRENT_SESSIONS_COOKIE_NAME
public static final java.lang.String CURRENT_SESSIONS_COOKIE_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSessionIdFromCookie
public java.lang.String getSessionIdFromCookie(javax.servlet.http.HttpServletRequest request)
-
getUmaSessionIdFromCookie
public java.lang.String getUmaSessionIdFromCookie(javax.servlet.http.HttpServletRequest request)
-
getConsentSessionIdFromCookie
public java.lang.String getConsentSessionIdFromCookie(javax.servlet.http.HttpServletRequest request)
-
getSessionStateFromCookie
public java.lang.String getSessionStateFromCookie(javax.servlet.http.HttpServletRequest request)
-
getCurrentSessions
public java.util.Set<java.lang.String> getCurrentSessions()
-
getCurrentSessions
public java.util.Set<java.lang.String> getCurrentSessions(javax.servlet.http.HttpServletRequest request)
-
addCurrentSessionCookie
public void addCurrentSessionCookie(SessionId sessionId, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse httpResponse)
-
getValueFromCookie
public java.lang.String getValueFromCookie(javax.servlet.http.HttpServletRequest request, java.lang.String cookieName)
-
getRpOriginIdCookie
public java.lang.String getRpOriginIdCookie()
-
getValueFromCookie
public java.lang.String getValueFromCookie(java.lang.String cookieName)
-
getSessionIdFromCookie
public java.lang.String getSessionIdFromCookie()
-
creatRpOriginIdCookie
public void creatRpOriginIdCookie(java.lang.String rpOriginId)
-
creatRpOriginIdCookie
public void creatRpOriginIdCookie(java.lang.String rpOriginId, javax.servlet.http.HttpServletResponse httpResponse)
-
createCookieWithState
public void createCookieWithState(java.lang.String sessionId, java.lang.String sessionState, java.lang.String opbs, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse httpResponse, java.lang.String cookieName)
-
createSessionIdCookie
public void createSessionIdCookie(SessionId sessionId, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse httpResponse, boolean isUma)
-
createSessionIdCookie
public void createSessionIdCookie(SessionId sessionId, boolean isUma)
-
createSessionStateCookie
public void createSessionStateCookie(java.lang.String sessionState, javax.servlet.http.HttpServletResponse httpResponse)
-
createOPBrowserStateCookie
public void createOPBrowserStateCookie(java.lang.String opbs, javax.servlet.http.HttpServletResponse httpResponse)
-
createCookie
protected void createCookie(java.lang.String header, javax.servlet.http.HttpServletResponse httpResponse)
-
removeSessionIdCookie
public void removeSessionIdCookie(javax.servlet.http.HttpServletResponse httpResponse)
-
removeOPBrowserStateCookie
public void removeOPBrowserStateCookie(javax.servlet.http.HttpServletResponse httpResponse)
-
removeUmaSessionIdCookie
public void removeUmaSessionIdCookie(javax.servlet.http.HttpServletResponse httpResponse)
-
removeConsentSessionIdCookie
public void removeConsentSessionIdCookie(javax.servlet.http.HttpServletResponse httpResponse)
-
removeCookie
public void removeCookie(java.lang.String cookieName, javax.servlet.http.HttpServletResponse httpResponse)
-
-