org.keycloak.services.managers

## Class AuthenticationManager

- java.lang.Object
- - org.keycloak.services.managers.AuthenticationManager

- Direct Known Subclasses:
    AppAuthManager

      public class AuthenticationManager
      extends Object

  Stateless object that manages authentication
  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `AuthenticationManager.AuthenticationStatus`
    `static class` | `AuthenticationManager.AuthResult`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `AUTH_TIME`
    `static String` | `CURRENT_REQUIRED_ACTION`
    `static String` | `END_AFTER_REQUIRED_ACTIONS`
    `static String` | `FORM_USERNAME`
    `static String` | `KEYCLOAK_IDENTITY_COOKIE`
    `static String` | `KEYCLOAK_LOGOUT_PROTOCOL`
    `static String` | `KEYCLOAK_REMEMBER_ME`
    `static String` | `KEYCLOAK_SESSION_COOKIE`
    `protected static ServicesLogger` | `logger`
    `static String` | `SSO_AUTH`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AuthenticationManager()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static javax.ws.rs.core.Response` | `actionRequired(KeycloakSession session, UserSessionModel userSession, ClientSessionModel clientSession, ClientConnection clientConnection, org.jboss.resteasy.spi.HttpRequest request, javax.ws.rs.core.UriInfo uriInfo, EventBuilder event)`
    `AuthenticationManager.AuthResult` | `authenticateIdentityCookie(KeycloakSession session, RealmModel realm)`
    `static AuthenticationManager.AuthResult` | `authenticateIdentityCookie(KeycloakSession session, RealmModel realm, boolean checkActive)`
    `static void` | `backchannelLogout(KeycloakSession session, RealmModel realm, UserSessionModel userSession, javax.ws.rs.core.UriInfo uriInfo, ClientConnection connection, javax.ws.rs.core.HttpHeaders headers, boolean logoutBroker)` Do not logout broker
    `static void` | `backchannelLogoutClientSession(KeycloakSession session, RealmModel realm, ClientSessionModel clientSession, UserSessionModel userSession, javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders headers)`
    `static void` | `backchannelUserFromClient(KeycloakSession session, RealmModel realm, UserModel user, ClientModel client, javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders headers)`
    `static javax.ws.rs.core.Response` | `browserLogout(KeycloakSession session, RealmModel realm, UserSessionModel userSession, javax.ws.rs.core.UriInfo uriInfo, ClientConnection connection, javax.ws.rs.core.HttpHeaders headers)`
    `static AccessToken` | `createIdentityToken(RealmModel realm, UserModel user, UserSessionModel session, String issuer)`
    `static void` | `createLoginCookie(KeycloakSession keycloakSession, RealmModel realm, UserModel user, UserSessionModel session, javax.ws.rs.core.UriInfo uriInfo, ClientConnection connection)`
    `static void` | `createRememberMeCookie(RealmModel realm, String username, javax.ws.rs.core.UriInfo uriInfo, ClientConnection connection)`
    `protected static String` | `encodeToken(RealmModel realm, Object token)`
    `static void` | `evaluateRequiredActionTriggers(KeycloakSession session, UserSessionModel userSession, ClientSessionModel clientSession, ClientConnection clientConnection, org.jboss.resteasy.spi.HttpRequest request, javax.ws.rs.core.UriInfo uriInfo, EventBuilder event, RealmModel realm, UserModel user)`
    `protected static javax.ws.rs.core.Response` | `executionActions(KeycloakSession session, UserSessionModel userSession, ClientSessionModel clientSession, org.jboss.resteasy.spi.HttpRequest request, EventBuilder event, RealmModel realm, UserModel user, Set<String> requiredActions)`
    `static void` | `expireCookie(RealmModel realm, String cookieName, String path, boolean httpOnly, ClientConnection connection)`
    `static void` | `expireIdentityCookie(RealmModel realm, javax.ws.rs.core.UriInfo uriInfo, ClientConnection connection)`
    `static void` | `expireRememberMeCookie(RealmModel realm, javax.ws.rs.core.UriInfo uriInfo, ClientConnection connection)`
    `static void` | `expireUserSessionCookie(KeycloakSession session, UserSessionModel userSession, RealmModel realm, javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders headers, ClientConnection connection)`
    `static javax.ws.rs.core.Response` | `finishBrowserLogout(KeycloakSession session, RealmModel realm, UserSessionModel userSession, javax.ws.rs.core.UriInfo uriInfo, ClientConnection connection, javax.ws.rs.core.HttpHeaders headers)`
    `static javax.ws.rs.core.Response` | `finishedRequiredActions(KeycloakSession session, UserSessionModel userSession, ClientSessionModel clientSession, ClientConnection clientConnection, org.jboss.resteasy.spi.HttpRequest request, javax.ws.rs.core.UriInfo uriInfo, EventBuilder event)`
    `protected static String` | `getIdentityCookiePath(RealmModel realm, javax.ws.rs.core.UriInfo uriInfo)`
    `static String` | `getRealmCookiePath(RealmModel realm, javax.ws.rs.core.UriInfo uriInfo)`
    `static String` | `getRememberMeUsername(RealmModel realm, javax.ws.rs.core.HttpHeaders headers)`
    `static boolean` | `isActionRequired(KeycloakSession session, UserSessionModel userSession, ClientSessionModel clientSession, ClientConnection clientConnection, org.jboss.resteasy.spi.HttpRequest request, javax.ws.rs.core.UriInfo uriInfo, EventBuilder event)`
    `static boolean` | `isSessionValid(RealmModel realm, UserSessionModel userSession)`
    `static boolean` | `isSSOAuthentication(ClientSessionModel clientSession)`
    `static javax.ws.rs.core.Response` | `nextActionAfterAuthentication(KeycloakSession session, UserSessionModel userSession, ClientSessionModel clientSession, ClientConnection clientConnection, org.jboss.resteasy.spi.HttpRequest request, javax.ws.rs.core.UriInfo uriInfo, EventBuilder event)`
    `static javax.ws.rs.core.Response` | `redirectAfterSuccessfulFlow(KeycloakSession session, RealmModel realm, UserSessionModel userSession, ClientSessionModel clientSession, org.jboss.resteasy.spi.HttpRequest request, javax.ws.rs.core.UriInfo uriInfo, ClientConnection clientConnection, EventBuilder event)`
    `static javax.ws.rs.core.Response` | `redirectAfterSuccessfulFlow(KeycloakSession session, RealmModel realm, UserSessionModel userSession, ClientSessionModel clientSession, org.jboss.resteasy.spi.HttpRequest request, javax.ws.rs.core.UriInfo uriInfo, ClientConnection clientConnection, EventBuilder event, LoginProtocol protocol)`
    `protected static AuthenticationManager.AuthResult` | `verifyIdentityToken(KeycloakSession session, RealmModel realm, javax.ws.rs.core.UriInfo uriInfo, ClientConnection connection, boolean checkActive, boolean checkTokenType, String tokenString, javax.ws.rs.core.HttpHeaders headers)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### END_AFTER_REQUIRED_ACTIONS

          public static final String END_AFTER_REQUIRED_ACTIONS

      See Also:
        Constant Field Values

    - #### AUTH_TIME

          public static final String AUTH_TIME

      See Also:
        Constant Field Values

    - #### SSO_AUTH

          public static final String SSO_AUTH

      See Also:
        Constant Field Values

    - #### logger

          protected static ServicesLogger logger

    - #### FORM_USERNAME

          public static final String FORM_USERNAME

      See Also:
        Constant Field Values

    - #### KEYCLOAK_IDENTITY_COOKIE

          public static final String KEYCLOAK_IDENTITY_COOKIE

      See Also:
        Constant Field Values

    - #### KEYCLOAK_SESSION_COOKIE

          public static final String KEYCLOAK_SESSION_COOKIE

      See Also:
        Constant Field Values

    - #### KEYCLOAK_REMEMBER_ME

          public static final String KEYCLOAK_REMEMBER_ME

      See Also:
        Constant Field Values

    - #### KEYCLOAK_LOGOUT_PROTOCOL

          public static final String KEYCLOAK_LOGOUT_PROTOCOL

      See Also:
        Constant Field Values

    - #### CURRENT_REQUIRED_ACTION

          public static final String CURRENT_REQUIRED_ACTION

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### AuthenticationManager

          public AuthenticationManager()

  - ### Method Detail

    - #### isSessionValid

          public static boolean isSessionValid(RealmModel realm,
                                               UserSessionModel userSession)

    - #### expireUserSessionCookie

          public static void expireUserSessionCookie(KeycloakSession session,
                                                     UserSessionModel userSession,
                                                     RealmModel realm,
                                                     javax.ws.rs.core.UriInfo uriInfo,
                                                     javax.ws.rs.core.HttpHeaders headers,
                                                     ClientConnection connection)

    - #### backchannelLogout

          public static void backchannelLogout(KeycloakSession session,
                                               RealmModel realm,
                                               UserSessionModel userSession,
                                               javax.ws.rs.core.UriInfo uriInfo,
                                               ClientConnection connection,
                                               javax.ws.rs.core.HttpHeaders headers,
                                               boolean logoutBroker)

      Do not logout broker
      Parameters:
        `session` -
        `realm` -
        `userSession` -
        `uriInfo` -
        `connection` -
        `headers` -

    - #### backchannelLogoutClientSession

          public static void backchannelLogoutClientSession(KeycloakSession session,
                                                            RealmModel realm,
                                                            ClientSessionModel clientSession,
                                                            UserSessionModel userSession,
                                                            javax.ws.rs.core.UriInfo uriInfo,
                                                            javax.ws.rs.core.HttpHeaders headers)

    - #### backchannelUserFromClient

          public static void backchannelUserFromClient(KeycloakSession session,
                                                       RealmModel realm,
                                                       UserModel user,
                                                       ClientModel client,
                                                       javax.ws.rs.core.UriInfo uriInfo,
                                                       javax.ws.rs.core.HttpHeaders headers)

    - #### browserLogout

          public static javax.ws.rs.core.Response browserLogout(KeycloakSession session,
                                                                RealmModel realm,
                                                                UserSessionModel userSession,
                                                                javax.ws.rs.core.UriInfo uriInfo,
                                                                ClientConnection connection,
                                                                javax.ws.rs.core.HttpHeaders headers)

    - #### finishBrowserLogout

          public static javax.ws.rs.core.Response finishBrowserLogout(KeycloakSession session,
                                                                      RealmModel realm,
                                                                      UserSessionModel userSession,
                                                                      javax.ws.rs.core.UriInfo uriInfo,
                                                                      ClientConnection connection,
                                                                      javax.ws.rs.core.HttpHeaders headers)

    - #### createIdentityToken

          public static AccessToken createIdentityToken(RealmModel realm,
                                                        UserModel user,
                                                        UserSessionModel session,
                                                        String issuer)

    - #### createLoginCookie

          public static void createLoginCookie(KeycloakSession keycloakSession,
                                               RealmModel realm,
                                               UserModel user,
                                               UserSessionModel session,
                                               javax.ws.rs.core.UriInfo uriInfo,
                                               ClientConnection connection)

    - #### createRememberMeCookie

          public static void createRememberMeCookie(RealmModel realm,
                                                    String username,
                                                    javax.ws.rs.core.UriInfo uriInfo,
                                                    ClientConnection connection)

    - #### getRememberMeUsername

          public static String getRememberMeUsername(RealmModel realm,
                                                     javax.ws.rs.core.HttpHeaders headers)

    - #### encodeToken

          protected static String encodeToken(RealmModel realm,
                                              Object token)

    - #### expireIdentityCookie

          public static void expireIdentityCookie(RealmModel realm,
                                                  javax.ws.rs.core.UriInfo uriInfo,
                                                  ClientConnection connection)

    - #### expireRememberMeCookie

          public static void expireRememberMeCookie(RealmModel realm,
                                                    javax.ws.rs.core.UriInfo uriInfo,
                                                    ClientConnection connection)

    - #### getIdentityCookiePath

          protected static String getIdentityCookiePath(RealmModel realm,
                                                        javax.ws.rs.core.UriInfo uriInfo)

    - #### getRealmCookiePath

          public static String getRealmCookiePath(RealmModel realm,
                                                  javax.ws.rs.core.UriInfo uriInfo)

    - #### expireCookie

          public static void expireCookie(RealmModel realm,
                                          String cookieName,
                                          String path,
                                          boolean httpOnly,
                                          ClientConnection connection)

    - #### authenticateIdentityCookie

          public AuthenticationManager.AuthResult authenticateIdentityCookie(KeycloakSession session,
                                                                             RealmModel realm)

    - #### authenticateIdentityCookie

          public static AuthenticationManager.AuthResult authenticateIdentityCookie(KeycloakSession session,
                                                                                    RealmModel realm,
                                                                                    boolean checkActive)

    - #### redirectAfterSuccessfulFlow

          public static javax.ws.rs.core.Response redirectAfterSuccessfulFlow(KeycloakSession session,
                                                                              RealmModel realm,
                                                                              UserSessionModel userSession,
                                                                              ClientSessionModel clientSession,
                                                                              org.jboss.resteasy.spi.HttpRequest request,
                                                                              javax.ws.rs.core.UriInfo uriInfo,
                                                                              ClientConnection clientConnection,
                                                                              EventBuilder event)

    - #### redirectAfterSuccessfulFlow

          public static javax.ws.rs.core.Response redirectAfterSuccessfulFlow(KeycloakSession session,
                                                                              RealmModel realm,
                                                                              UserSessionModel userSession,
                                                                              ClientSessionModel clientSession,
                                                                              org.jboss.resteasy.spi.HttpRequest request,
                                                                              javax.ws.rs.core.UriInfo uriInfo,
                                                                              ClientConnection clientConnection,
                                                                              EventBuilder event,
                                                                              LoginProtocol protocol)

    - #### isSSOAuthentication

          public static boolean isSSOAuthentication(ClientSessionModel clientSession)

    - #### nextActionAfterAuthentication

          public static javax.ws.rs.core.Response nextActionAfterAuthentication(KeycloakSession session,
                                                                                UserSessionModel userSession,
                                                                                ClientSessionModel clientSession,
                                                                                ClientConnection clientConnection,
                                                                                org.jboss.resteasy.spi.HttpRequest request,
                                                                                javax.ws.rs.core.UriInfo uriInfo,
                                                                                EventBuilder event)

    - #### finishedRequiredActions

          public static javax.ws.rs.core.Response finishedRequiredActions(KeycloakSession session,
                                                                          UserSessionModel userSession,
                                                                          ClientSessionModel clientSession,
                                                                          ClientConnection clientConnection,
                                                                          org.jboss.resteasy.spi.HttpRequest request,
                                                                          javax.ws.rs.core.UriInfo uriInfo,
                                                                          EventBuilder event)

    - #### isActionRequired

          public static boolean isActionRequired(KeycloakSession session,
                                                 UserSessionModel userSession,
                                                 ClientSessionModel clientSession,
                                                 ClientConnection clientConnection,
                                                 org.jboss.resteasy.spi.HttpRequest request,
                                                 javax.ws.rs.core.UriInfo uriInfo,
                                                 EventBuilder event)

    - #### actionRequired

          public static javax.ws.rs.core.Response actionRequired(KeycloakSession session,
                                                                 UserSessionModel userSession,
                                                                 ClientSessionModel clientSession,
                                                                 ClientConnection clientConnection,
                                                                 org.jboss.resteasy.spi.HttpRequest request,
                                                                 javax.ws.rs.core.UriInfo uriInfo,
                                                                 EventBuilder event)

    - #### executionActions

          protected static javax.ws.rs.core.Response executionActions(KeycloakSession session,
                                                                      UserSessionModel userSession,
                                                                      ClientSessionModel clientSession,
                                                                      org.jboss.resteasy.spi.HttpRequest request,
                                                                      EventBuilder event,
                                                                      RealmModel realm,
                                                                      UserModel user,
                                                                      Set<String> requiredActions)

    - #### evaluateRequiredActionTriggers

          public static void evaluateRequiredActionTriggers(KeycloakSession session,
                                                            UserSessionModel userSession,
                                                            ClientSessionModel clientSession,
                                                            ClientConnection clientConnection,
                                                            org.jboss.resteasy.spi.HttpRequest request,
                                                            javax.ws.rs.core.UriInfo uriInfo,
                                                            EventBuilder event,
                                                            RealmModel realm,
                                                            UserModel user)

    - #### verifyIdentityToken

          protected static AuthenticationManager.AuthResult verifyIdentityToken(KeycloakSession session,
                                                                                RealmModel realm,
                                                                                javax.ws.rs.core.UriInfo uriInfo,
                                                                                ClientConnection connection,
                                                                                boolean checkActive,
                                                                                boolean checkTokenType,
                                                                                String tokenString,
                                                                                javax.ws.rs.core.HttpHeaders headers)

Copyright © 2016 JBoss by Red Hat. All rights reserved.