Class CookieService


  • @RequestScoped
    public class CookieService
    extends java.lang.Object
    Author:
    Yuriy Zabrovarnyy
    • 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
    • Constructor Detail

      • CookieService

        public CookieService()
    • Method Detail

      • getSessionIdFromCookie

        public java.lang.String getSessionIdFromCookie​(jakarta.servlet.http.HttpServletRequest request)
      • getUmaSessionIdFromCookie

        public java.lang.String getUmaSessionIdFromCookie​(jakarta.servlet.http.HttpServletRequest request)
      • getConsentSessionIdFromCookie

        public java.lang.String getConsentSessionIdFromCookie​(jakarta.servlet.http.HttpServletRequest request)
      • getSessionStateFromCookie

        public java.lang.String getSessionStateFromCookie​(jakarta.servlet.http.HttpServletRequest request)
      • getCurrentSessions

        public java.util.Set<java.lang.String> getCurrentSessions()
      • getCurrentSessions

        public java.util.Set<java.lang.String> getCurrentSessions​(jakarta.servlet.http.HttpServletRequest request)
      • addCurrentSessionCookie

        public void addCurrentSessionCookie​(io.jans.as.common.model.session.SessionId sessionId,
                                            jakarta.servlet.http.HttpServletRequest request,
                                            jakarta.servlet.http.HttpServletResponse httpResponse)
      • getValueFromCookie

        public java.lang.String getValueFromCookie​(jakarta.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,
                                          jakarta.servlet.http.HttpServletResponse httpResponse)
      • createCookieWithState

        public void createCookieWithState​(java.lang.String sessionId,
                                          java.lang.String sessionState,
                                          java.lang.String opbs,
                                          jakarta.servlet.http.HttpServletRequest request,
                                          jakarta.servlet.http.HttpServletResponse httpResponse,
                                          java.lang.String cookieName)
      • createSessionIdCookie

        public void createSessionIdCookie​(io.jans.as.common.model.session.SessionId sessionId,
                                          jakarta.servlet.http.HttpServletRequest request,
                                          jakarta.servlet.http.HttpServletResponse httpResponse,
                                          boolean isUma)
      • createSessionIdCookie

        public void createSessionIdCookie​(io.jans.as.common.model.session.SessionId sessionId,
                                          boolean isUma)
      • createSessionStateCookie

        public void createSessionStateCookie​(java.lang.String sessionState,
                                             jakarta.servlet.http.HttpServletResponse httpResponse)
      • createOPBrowserStateCookie

        public void createOPBrowserStateCookie​(java.lang.String opbs,
                                               jakarta.servlet.http.HttpServletResponse httpResponse)
      • createCookie

        protected void createCookie​(java.lang.String header,
                                    jakarta.servlet.http.HttpServletResponse httpResponse)
      • removeSessionIdCookie

        public void removeSessionIdCookie​(jakarta.servlet.http.HttpServletResponse httpResponse)
      • removeOPBrowserStateCookie

        public void removeOPBrowserStateCookie​(jakarta.servlet.http.HttpServletResponse httpResponse)
      • removeUmaSessionIdCookie

        public void removeUmaSessionIdCookie​(jakarta.servlet.http.HttpServletResponse httpResponse)
      • removeConsentSessionIdCookie

        public void removeConsentSessionIdCookie​(jakarta.servlet.http.HttpServletResponse httpResponse)
      • removeCookie

        public void removeCookie​(java.lang.String cookieName,
                                 jakarta.servlet.http.HttpServletResponse httpResponse)