Merge pull request #4033 from sebastienblanc/KEYCLOAK-3818

KEYCLOAK-3818 : safer method to retrieve the webcontext for jetty
This commit is contained in:
Stian Thorgersen 2017-04-21 11:20:59 +02:00 committed by GitHub
commit b45089f5f0

View file

@ -210,6 +210,10 @@ public class KeycloakSpringBootConfiguration {
}
WebAppContext webAppContext = server.getBean(WebAppContext.class);
//if not found as registered bean let's try the handler
if(webAppContext==null){
webAppContext = (WebAppContext) server.getHandler();
}
ConstraintSecurityHandler securityHandler = new ConstraintSecurityHandler();
securityHandler.setConstraintMappings(jettyConstraintMappings);