Search in sources :

Example 6 with PreAuthActionsHandler

use of org.keycloak.adapters.PreAuthActionsHandler in project keycloak by keycloak.

the class AbstractKeycloakAuthenticatorValve method invoke.

@Override
public void invoke(Request request, Response response) throws IOException, ServletException {
    try {
        CatalinaHttpFacade facade = new OIDCCatalinaHttpFacade(request, response);
        Manager sessionManager = request.getContext().getManager();
        CatalinaUserSessionManagementWrapper sessionManagementWrapper = new CatalinaUserSessionManagementWrapper(userSessionManagement, sessionManager);
        PreAuthActionsHandler handler = new PreAuthActionsHandler(sessionManagementWrapper, deploymentContext, facade);
        if (handler.handleRequest()) {
            return;
        }
        checkKeycloakSession(request, facade);
        super.invoke(request, response);
    } finally {
    }
}
Also used : PreAuthActionsHandler(org.keycloak.adapters.PreAuthActionsHandler)

Example 7 with PreAuthActionsHandler

use of org.keycloak.adapters.PreAuthActionsHandler in project keycloak by keycloak.

the class ServletPreAuthActionsHandler method handleRequest.

@Override
public void handleRequest(HttpServerExchange exchange) throws Exception {
    UndertowHttpFacade facade = new OIDCServletUndertowHttpFacade(exchange);
    final ServletRequestContext servletRequestContext = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY);
    SessionManagementBridge bridge = new SessionManagementBridge(userSessionManagement, servletRequestContext.getDeployment().getSessionManager());
    PreAuthActionsHandler handler = new PreAuthActionsHandler(bridge, deploymentContext, facade);
    if (handler.handleRequest())
        return;
    next.handleRequest(exchange);
}
Also used : ServletRequestContext(io.undertow.servlet.handlers.ServletRequestContext) PreAuthActionsHandler(org.keycloak.adapters.PreAuthActionsHandler)

Example 8 with PreAuthActionsHandler

use of org.keycloak.adapters.PreAuthActionsHandler in project keycloak by keycloak.

the class UndertowPreAuthActionsHandler method handleRequest.

@Override
public void handleRequest(HttpServerExchange exchange) throws Exception {
    UndertowHttpFacade facade = createFacade(exchange);
    SessionManagementBridge bridge = new SessionManagementBridge(userSessionManagement, sessionManager);
    PreAuthActionsHandler handler = new PreAuthActionsHandler(bridge, deploymentContext, facade);
    if (handler.handleRequest())
        return;
    next.handleRequest(exchange);
}
Also used : PreAuthActionsHandler(org.keycloak.adapters.PreAuthActionsHandler)

Aggregations

PreAuthActionsHandler (org.keycloak.adapters.PreAuthActionsHandler)8 KeycloakDeployment (org.keycloak.adapters.KeycloakDeployment)4 AuthenticatedActionsHandler (org.keycloak.adapters.AuthenticatedActionsHandler)3 AuthChallenge (org.keycloak.adapters.spi.AuthChallenge)3 AuthOutcome (org.keycloak.adapters.spi.AuthOutcome)3 AdapterTokenStore (org.keycloak.adapters.AdapterTokenStore)2 SecurityContext (io.undertow.security.api.SecurityContext)1 Account (io.undertow.security.idm.Account)1 SecurityContextImpl (io.undertow.security.impl.SecurityContextImpl)1 ServletRequestContext (io.undertow.servlet.handlers.ServletRequestContext)1 ServletRequest (javax.servlet.ServletRequest)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 HttpServletRequestWrapper (javax.servlet.http.HttpServletRequestWrapper)1 HttpServletResponse (javax.servlet.http.HttpServletResponse)1 UserAuthentication (org.eclipse.jetty.security.UserAuthentication)1 DeferredAuthentication (org.eclipse.jetty.security.authentication.DeferredAuthentication)1 Authentication (org.eclipse.jetty.server.Authentication)1 Request (org.eclipse.jetty.server.Request)1 NodesRegistrationManagement (org.keycloak.adapters.NodesRegistrationManagement)1 RequestAuthenticator (org.keycloak.adapters.RequestAuthenticator)1