Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.keycloak.adapters.tomcat7;
Pre-installed actions that must be authenticated

Actions include:

CORS Origin Check and Response headers k_query_bearer_token: Get bearer token from server for Javascripts CORS requests

Davide Ungari
$Revision: 1 $
public class AuthenticatedActionsValve extends ValveBase {
    private static final Logger log = Logger.getLogger(""+AuthenticatedActionsValve.class);
    public AuthenticatedActionsValve(AdapterDeploymentContext deploymentContextValve nextContainer containerObjectName controller) {
        this. = deploymentContext;
        if (next == nullthrow new RuntimeException("WTF is next null?!");
    public void invoke(Request requestResponse responsethrows IOExceptionServletException {
        .finer("AuthenticatedActionsValve.invoke" + request.getRequestURI());
        CatalinaHttpFacade facade = new CatalinaHttpFacade(requestresponse);
        KeycloakDeployment deployment = .resolveDeployment(facade);
        if (deployment != null && deployment.isConfigured()) {
            AuthenticatedActionsHandler handler = new AuthenticatedActionsHandler(deploymentnew CatalinaHttpFacade(requestresponse));
            if (handler.handledRequest()) {
New to GrepCode? Check out our FAQ X