Class AuthenticationSessionManager

    • Constructor Detail

      • AuthenticationSessionManager

        public AuthenticationSessionManager​(org.keycloak.models.KeycloakSession session)
    • Method Detail

      • createAuthenticationSession

        public org.keycloak.sessions.RootAuthenticationSessionModel createAuthenticationSession​(org.keycloak.models.RealmModel realm,
                                                                                                boolean browserCookie)
        Creates a fresh authentication session for the given realm . Optionally sets the browser authentication session cookie AUTH_SESSION_ID with the ID of the new session.
        Parameters:
        realm -
        browserCookie - Set the cookie in the browser for the
        Returns:
      • getCurrentRootAuthenticationSession

        public org.keycloak.sessions.RootAuthenticationSessionModel getCurrentRootAuthenticationSession​(org.keycloak.models.RealmModel realm)
      • getUserSessionFromAuthCookie

        public org.keycloak.models.UserSessionModel getUserSessionFromAuthCookie​(org.keycloak.models.RealmModel realm)
      • getCurrentAuthenticationSession

        public org.keycloak.sessions.AuthenticationSessionModel getCurrentAuthenticationSession​(org.keycloak.models.RealmModel realm,
                                                                                                org.keycloak.models.ClientModel client,
                                                                                                String tabId)
        Returns current authentication session if it exists, otherwise returns null.
        Parameters:
        realm -
        Returns:
      • setAuthSessionCookie

        public void setAuthSessionCookie​(String authSessionId,
                                         org.keycloak.models.RealmModel realm)
        Parameters:
        authSessionId - decoded authSessionId (without route info attached)
        realm -
      • removeAuthenticationSession

        public void removeAuthenticationSession​(org.keycloak.models.RealmModel realm,
                                                org.keycloak.sessions.AuthenticationSessionModel authSession,
                                                boolean expireRestartCookie)
      • getUserSession

        public org.keycloak.models.UserSessionModel getUserSession​(org.keycloak.sessions.AuthenticationSessionModel authSession)
      • getAuthenticationSessionByIdAndClient

        public org.keycloak.sessions.AuthenticationSessionModel getAuthenticationSessionByIdAndClient​(org.keycloak.models.RealmModel realm,
                                                                                                      String authSessionId,
                                                                                                      org.keycloak.models.ClientModel client,
                                                                                                      String tabId)