org.keycloak.adapters.jetty.core

## Class AbstractKeycloakJettyAuthenticator

- java.lang.Object
- - org.eclipse.jetty.security.authentication.LoginAuthenticator
  - - org.keycloak.adapters.jetty.core.AbstractKeycloakJettyAuthenticator

- All Implemented Interfaces:
    org.eclipse.jetty.security.Authenticator
  Direct Known Subclasses:
    KeycloakJettyAuthenticator

      public abstract class AbstractKeycloakJettyAuthenticator
      extends org.eclipse.jetty.security.authentication.LoginAuthenticator

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `AbstractKeycloakJettyAuthenticator.KeycloakAuthentication`

    - ### Nested classes/interfaces inherited from interface org.eclipse.jetty.security.Authenticator

      `org.eclipse.jetty.security.Authenticator.AuthConfiguration, org.eclipse.jetty.security.Authenticator.Factory`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected AdapterConfig` | `adapterConfig`
    `protected KeycloakConfigResolver` | `configResolver`
    `protected AdapterDeploymentContext` | `deploymentContext`
    `protected String` | `errorPage`
    `protected static org.jboss.logging.Logger` | `log`
    `protected NodesRegistrationManagement` | `nodesRegistrationManagement`
    `static String` | `TOKEN_STORE_NOTE`

    - ### Fields inherited from class org.eclipse.jetty.security.authentication.LoginAuthenticator

      `_identityService, _loginService`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractKeycloakJettyAuthenticator()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract org.eclipse.jetty.server.Authentication` | `createAuthentication(org.eclipse.jetty.server.UserIdentity userIdentity)`
    `static org.eclipse.jetty.server.UserIdentity` | `createIdentity(KeycloakPrincipal<RefreshableKeycloakSecurityContext> principal)`
    `protected JettyRequestAuthenticator` | `createRequestAuthenticator(org.eclipse.jetty.server.Request request, JettyHttpFacade facade, KeycloakDeployment deployment, AdapterTokenStore tokenStore)`
    `abstract AdapterTokenStore` | `createSessionTokenStore(org.eclipse.jetty.server.Request request, KeycloakDeployment resolvedDeployment)`
    `AdapterConfig` | `getAdapterConfig()`
    `String` | `getAuthMethod()`
    `KeycloakConfigResolver` | `getConfigResolver()`
    `AdapterTokenStore` | `getTokenStore(org.eclipse.jetty.server.Request request, HttpFacade facade, KeycloakDeployment resolvedDeployment)`
    `void` | `initializeKeycloak()`
    `void` | `logoutCurrent(org.eclipse.jetty.server.Request request)`
    `protected org.eclipse.jetty.server.Authentication` | `register(org.eclipse.jetty.server.Request request, KeycloakPrincipal<RefreshableKeycloakSecurityContext> principal)`
    `protected abstract org.eclipse.jetty.server.Request` | `resolveRequest(javax.servlet.ServletRequest req)`
    `boolean` | `secureResponse(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res, boolean mandatory, org.eclipse.jetty.server.Authentication.User validatedUser)`
    `void` | `setAdapterConfig(AdapterConfig adapterConfig)`
    `void` | `setConfigResolver(KeycloakConfigResolver configResolver)`
    `void` | `setConfiguration(org.eclipse.jetty.security.Authenticator.AuthConfiguration configuration)`
    `org.eclipse.jetty.server.Authentication` | `validateRequest(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res, boolean mandatory)`

    - ### Methods inherited from class org.eclipse.jetty.security.authentication.LoginAuthenticator

      `getLoginService, login, prepareRequest, renewSession`

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

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

- - ### Field Detail

    - #### TOKEN_STORE_NOTE

          public static final String TOKEN_STORE_NOTE

      See Also:
        Constant Field Values

    - #### log

          protected static final org.jboss.logging.Logger log

    - #### deploymentContext

          protected AdapterDeploymentContext deploymentContext

    - #### nodesRegistrationManagement

          protected NodesRegistrationManagement nodesRegistrationManagement

    - #### adapterConfig

          protected AdapterConfig adapterConfig

    - #### configResolver

          protected KeycloakConfigResolver configResolver

    - #### errorPage

          protected String errorPage

  - ### Constructor Detail

    - #### AbstractKeycloakJettyAuthenticator

          public AbstractKeycloakJettyAuthenticator()

  - ### Method Detail

    - #### getTokenStore

          public AdapterTokenStore getTokenStore(org.eclipse.jetty.server.Request request,
                                        HttpFacade facade,
                                        KeycloakDeployment resolvedDeployment)

    - #### createSessionTokenStore

          public abstract AdapterTokenStore createSessionTokenStore(org.eclipse.jetty.server.Request request,
                                                  KeycloakDeployment resolvedDeployment)

    - #### logoutCurrent

          public void logoutCurrent(org.eclipse.jetty.server.Request request)

    - #### createIdentity

          public static org.eclipse.jetty.server.UserIdentity createIdentity(KeycloakPrincipal<RefreshableKeycloakSecurityContext> principal)

    - #### setConfiguration

          public void setConfiguration(org.eclipse.jetty.security.Authenticator.AuthConfiguration configuration)

      Specified by:
        `setConfiguration` in interface `org.eclipse.jetty.security.Authenticator`
      Overrides:
        `setConfiguration` in class `org.eclipse.jetty.security.authentication.LoginAuthenticator`

    - #### secureResponse

          public boolean secureResponse(javax.servlet.ServletRequest req,
                               javax.servlet.ServletResponse res,
                               boolean mandatory,
                               org.eclipse.jetty.server.Authentication.User validatedUser)
                                 throws org.eclipse.jetty.security.ServerAuthException

      Throws:
        `org.eclipse.jetty.security.ServerAuthException`

    - #### getAdapterConfig

          public AdapterConfig getAdapterConfig()

    - #### setAdapterConfig

          public void setAdapterConfig(AdapterConfig adapterConfig)

    - #### getConfigResolver

          public KeycloakConfigResolver getConfigResolver()

    - #### setConfigResolver

          public void setConfigResolver(KeycloakConfigResolver configResolver)

    - #### initializeKeycloak

          public void initializeKeycloak()

    - #### validateRequest

          public org.eclipse.jetty.server.Authentication validateRequest(javax.servlet.ServletRequest req,
                                                                javax.servlet.ServletResponse res,
                                                                boolean mandatory)
                                                                  throws org.eclipse.jetty.security.ServerAuthException

      Throws:
        `org.eclipse.jetty.security.ServerAuthException`

    - #### resolveRequest

          protected abstract org.eclipse.jetty.server.Request resolveRequest(javax.servlet.ServletRequest req)

    - #### createRequestAuthenticator

          protected JettyRequestAuthenticator createRequestAuthenticator(org.eclipse.jetty.server.Request request,
                                                             JettyHttpFacade facade,
                                                             KeycloakDeployment deployment,
                                                             AdapterTokenStore tokenStore)

    - #### getAuthMethod

          public String getAuthMethod()

    - #### register

          protected org.eclipse.jetty.server.Authentication register(org.eclipse.jetty.server.Request request,
                                                         KeycloakPrincipal<RefreshableKeycloakSecurityContext> principal)

    - #### createAuthentication

          protected abstract org.eclipse.jetty.server.Authentication createAuthentication(org.eclipse.jetty.server.UserIdentity userIdentity)

Copyright © 2015. All Rights Reserved.