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`
    `class` | `AuthenticationManager.AuthResult`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `FORM_USERNAME`
    `static String` | `KEYCLOAK_IDENTITY_COOKIE`
    `static String` | `KEYCLOAK_REMEMBER_ME`
    `static String` | `KEYCLOAK_SESSION_COOKIE`
    `protected static org.jboss.logging.Logger` | `logger`
    `protected BruteForceProtector` | `protector`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AuthenticationManager()`
    `AuthenticationManager(BruteForceProtector protector)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `AuthenticationManager.AuthenticationStatus` | `authenticateForm(KeycloakSession session, ClientConnection clientConnection, RealmModel realm, javax.ws.rs.core.MultivaluedMap<String,String> formData)`
    `AuthenticationManager.AuthResult` | `authenticateIdentityCookie(KeycloakSession session, RealmModel realm, javax.ws.rs.core.UriInfo uriInfo, ClientConnection connection, javax.ws.rs.core.HttpHeaders headers)`
    `AuthenticationManager.AuthResult` | `authenticateIdentityCookie(KeycloakSession session, RealmModel realm, javax.ws.rs.core.UriInfo uriInfo, ClientConnection connection, javax.ws.rs.core.HttpHeaders headers, boolean checkActive)`
    `protected AuthenticationManager.AuthenticationStatus` | `authenticateInternal(KeycloakSession session, RealmModel realm, javax.ws.rs.core.MultivaluedMap<String,String> formData, String username)`
    `javax.ws.rs.core.Response` | `checkNonFormAuthentication(KeycloakSession session, ClientSessionModel clientSession, RealmModel realm, javax.ws.rs.core.UriInfo uriInfo, org.jboss.resteasy.spi.HttpRequest request, ClientConnection clientConnection, javax.ws.rs.core.HttpHeaders headers, EventBuilder event)`
    `static AccessToken` | `createIdentityToken(RealmModel realm, UserModel user, UserSessionModel session)`
    `static void` | `createLoginCookie(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` | `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)`
    `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)`
    `protected static void` | `isEmailVerificationRequired(RealmModel realm, UserModel user)`
    `static boolean` | `isSessionValid(RealmModel realm, UserSessionModel userSession)`
    `protected static void` | `isTotpConfigurationRequired(RealmModel realm, UserModel user)`
    `static void` | `logout(KeycloakSession session, RealmModel realm, UserSessionModel userSession, javax.ws.rs.core.UriInfo uriInfo, ClientConnection connection)`
    `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)`
    `protected AuthenticationManager.AuthResult` | `verifyIdentityToken(KeycloakSession session, RealmModel realm, javax.ws.rs.core.UriInfo uriInfo, ClientConnection connection, boolean checkActive, String tokenString)`

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

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

- - ### Field Detail

    - #### logger

          protected static org.jboss.logging.Logger 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

    - #### protector

          protected BruteForceProtector protector

  - ### Constructor Detail

    - #### AuthenticationManager

          public AuthenticationManager()

    - #### AuthenticationManager

          public AuthenticationManager(BruteForceProtector protector)

  - ### Method Detail

    - #### isSessionValid

          public static boolean isSessionValid(RealmModel realm,
                               UserSessionModel userSession)

    - #### logout

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

    - #### createIdentityToken

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

    - #### createLoginCookie

          public static void createLoginCookie(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,
                                                                    javax.ws.rs.core.UriInfo uriInfo,
                                                                    ClientConnection connection,
                                                                    javax.ws.rs.core.HttpHeaders headers)

    - #### authenticateIdentityCookie

          public AuthenticationManager.AuthResult authenticateIdentityCookie(KeycloakSession session,
                                                                    RealmModel realm,
                                                                    javax.ws.rs.core.UriInfo uriInfo,
                                                                    ClientConnection connection,
                                                                    javax.ws.rs.core.HttpHeaders headers,
                                                                    boolean checkActive)

    - #### checkNonFormAuthentication

          public javax.ws.rs.core.Response checkNonFormAuthentication(KeycloakSession session,
                                                             ClientSessionModel clientSession,
                                                             RealmModel realm,
                                                             javax.ws.rs.core.UriInfo uriInfo,
                                                             org.jboss.resteasy.spi.HttpRequest request,
                                                             ClientConnection clientConnection,
                                                             javax.ws.rs.core.HttpHeaders headers,
                                                             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)

    - #### 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)

    - #### isTotpConfigurationRequired

          protected static void isTotpConfigurationRequired(RealmModel realm,
                                         UserModel user)

    - #### isEmailVerificationRequired

          protected static void isEmailVerificationRequired(RealmModel realm,
                                         UserModel user)

    - #### verifyIdentityToken

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

    - #### authenticateForm

          public AuthenticationManager.AuthenticationStatus authenticateForm(KeycloakSession session,
                                                                    ClientConnection clientConnection,
                                                                    RealmModel realm,
                                                                    javax.ws.rs.core.MultivaluedMap<String,String> formData)

    - #### authenticateInternal

          protected AuthenticationManager.AuthenticationStatus authenticateInternal(KeycloakSession session,
                                                                        RealmModel realm,
                                                                        javax.ws.rs.core.MultivaluedMap<String,String> formData,
                                                                        String username)

Copyright © 2015. All Rights Reserved.