Skip to content

Instantly share code, notes, and snippets.

@jesty
Created October 7, 2016 22:17
Show Gist options
  • Save jesty/4f9fb6b0cb725b39210ebad428e71b1d to your computer and use it in GitHub Desktop.
Save jesty/4f9fb6b0cb725b39210ebad428e71b1d to your computer and use it in GitHub Desktop.
Configuring Keycloak Tomcat Adapter in Maven Tomcat adapter. You must edit your plugin configuration in pom.xml, add a context.xml file with the code above and enjoy wit mvn tomcat:run
<!-- pom.xml --->
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<path>/memento</path>
<port>9999</port>
<contextFile>src/main/webapp/META-INF/context.xml</contextFile>
<contextReloadable>true</contextReloadable>
</configuration>
<dependencies>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-tomcat7-adapter</artifactId>
<version>2.2.1.Final</version>
</dependency>
</dependencies>
</plugin>
</plugins>
<!-- context.xml --->
<Context path="/memento">
<Valve className="org.keycloak.adapters.tomcat.KeycloakAuthenticatorValve"/>
</Context>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment