Class SessionIdService


  • @RequestScoped
    @Named
    public class SessionIdService
    extends java.lang.Object
    Version:
    December 8, 2018
    Author:
    Yuriy Zabrovarnyy, Yuriy Movchan, Javier Rojas Blum
    • Field Detail

      • OP_BROWSER_STATE

        public static final java.lang.String OP_BROWSER_STATE
        See Also:
        Constant Field Values
      • SESSION_CUSTOM_STATE

        public static final java.lang.String SESSION_CUSTOM_STATE
        See Also:
        Constant Field Values
    • Constructor Detail

      • SessionIdService

        public SessionIdService()
    • Method Detail

      • getCurrentSessions

        public java.util.Set<SessionId> getCurrentSessions()
      • getAcr

        public java.lang.String getAcr​(SessionId session)
      • reinitLogin

        public boolean reinitLogin​(SessionId session,
                                   boolean force)
        Parameters:
        session -
        force -
        Returns:
        returns whether session was updated
      • getSessionId

        public SessionId getSessionId()
      • getSessionAttributes

        public java.util.Map<java.lang.String,​java.lang.String> getSessionAttributes​(SessionId sessionId)
      • generateUnauthenticatedSessionId

        public SessionId generateUnauthenticatedSessionId​(java.lang.String userDn)
      • generateUnauthenticatedSessionId

        public SessionId generateUnauthenticatedSessionId​(java.lang.String userDn,
                                                          java.util.Date authenticationDate,
                                                          SessionIdState state,
                                                          java.util.Map<java.lang.String,​java.lang.String> sessionIdAttributes,
                                                          boolean persist)
      • computeSessionState

        public java.lang.String computeSessionState​(SessionId sessionId,
                                                    java.lang.String clientId,
                                                    java.lang.String redirectUri)
      • setSessionIdStateAuthenticated

        public SessionId setSessionIdStateAuthenticated​(javax.servlet.http.HttpServletRequest httpRequest,
                                                        javax.servlet.http.HttpServletResponse httpResponse,
                                                        SessionId sessionId,
                                                        java.lang.String userDn)
      • persistSessionId

        public boolean persistSessionId​(SessionId sessionId)
      • persistSessionId

        public boolean persistSessionId​(SessionId sessionId,
                                        boolean forcePersistence)
      • updateSessionId

        public boolean updateSessionId​(SessionId sessionId)
      • updateSessionId

        public boolean updateSessionId​(SessionId sessionId,
                                       boolean updateLastUsedAt)
      • updateSessionId

        public boolean updateSessionId​(SessionId sessionId,
                                       boolean updateLastUsedAt,
                                       boolean forceUpdate,
                                       boolean modified)
      • isExpired

        public boolean isExpired​(SessionId sessionId)
      • getServerSessionIdLifetimeInSeconds

        public int getServerSessionIdLifetimeInSeconds()
      • updateSessionIdIfNeeded

        public void updateSessionIdIfNeeded​(SessionId sessionId,
                                            boolean modified)
      • getSessionById

        @Nullable
        public @Nullable SessionId getSessionById​(@Nullable
                                                  @Nullable java.lang.String sessionId,
                                                  boolean silently)
      • getSessionByDn

        @Nullable
        public @Nullable SessionId getSessionByDn​(@Nullable
                                                  @Nullable java.lang.String dn)
      • getSessionBySid

        @Nullable
        public @Nullable SessionId getSessionBySid​(@Nullable
                                                   @Nullable java.lang.String sid)
      • getSessionByDn

        @Nullable
        public @Nullable SessionId getSessionByDn​(@Nullable
                                                  @Nullable java.lang.String dn,
                                                  boolean silently)
      • getSessionId

        public SessionId getSessionId​(javax.servlet.http.HttpServletRequest request)
      • getSessionId

        public SessionId getSessionId​(java.lang.String sessionId)
      • getSessionId

        public SessionId getSessionId​(java.lang.String sessionId,
                                      boolean silently)
      • remove

        public boolean remove​(SessionId sessionId)
      • remove

        public void remove​(java.util.List<SessionId> list)
      • isSessionValid

        public boolean isSessionValid​(SessionId sessionId)
      • isSessionIdAuthenticated

        public boolean isSessionIdAuthenticated​(SessionId sessionId)
      • acrValuesList

        public java.util.List<java.lang.String> acrValuesList​(java.lang.String acrValues)
        By definition we expects space separated acr values as it is defined in spec. But we also try maybe some client sent it to us as json array. So we try both.
        Returns:
        acr value list
      • getUser

        public io.jans.as.common.model.common.User getUser​(SessionId sessionId)
      • findByUser

        public java.util.List<SessionId> findByUser​(java.lang.String userDn)
      • externalEvent

        public void externalEvent​(SessionEvent event)