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)`
    `AccessToken` | `createIdentityToken(RealmModel realm, UserModel user, UserSessionModel session)`
    `void` | `createLoginCookie(RealmModel realm, UserModel user, UserSessionModel session, javax.ws.rs.core.UriInfo uriInfo, ClientConnection connection)`
    `void` | `createRememberMeCookie(RealmModel realm, String username, javax.ws.rs.core.UriInfo uriInfo, ClientConnection connection)`
    `protected 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 boolean` | `isSessionValid(RealmModel realm, UserSessionModel userSession)`
    `static void` | `logout(KeycloakSession session, RealmModel realm, UserSessionModel userSession, javax.ws.rs.core.UriInfo uriInfo, ClientConnection connection)`
    `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 AccessToken createIdentityToken(RealmModel realm,
                                        UserModel user,
                                        UserSessionModel session)

    - #### createLoginCookie

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

    - #### createRememberMeCookie

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

    - #### encodeToken

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

    - #### 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 © 2014. All Rights Reserved.