KEYCLOAK-955 Fix AeroGear project integration example

This commit is contained in:
Stian Thorgersen 2015-01-14 14:31:39 +01:00
parent 29b8c2c924
commit b16845a09e
9 changed files with 32 additions and 53 deletions

View file

@ -117,6 +117,10 @@ public class DefaultJpaConnectionProviderFactory implements JpaConnectionProvide
logger.trace("Updating database"); logger.trace("Updating database");
JpaUpdaterProvider updater = session.getProvider(JpaUpdaterProvider.class); JpaUpdaterProvider updater = session.getProvider(JpaUpdaterProvider.class);
if (updater == null) {
throw new RuntimeException("Can't update database: JPA updater provider not found");
}
connection = getConnection(); connection = getConnection();
if (databaseSchema.equals("update")) { if (databaseSchema.equals("update")) {

View file

@ -194,6 +194,12 @@
<dependency> <dependency>
<groupId>de.idyl</groupId> <groupId>de.idyl</groupId>
<artifactId>winzipaes</artifactId> <artifactId>winzipaes</artifactId>
<exclusions>
<exclusion>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk16</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>

View file

@ -24,6 +24,10 @@
<groupId>net.iharder</groupId> <groupId>net.iharder</groupId>
<artifactId>base64</artifactId> <artifactId>base64</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk16</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.keycloak</groupId> <groupId>org.keycloak</groupId>
<artifactId>keycloak-core-jaxrs</artifactId> <artifactId>keycloak-core-jaxrs</artifactId>

View file

@ -1,33 +0,0 @@
package org.keycloak.example;
import org.keycloak.adapters.AdapterDeploymentContext;
import org.keycloak.enums.SslRequired;
import org.keycloak.representations.adapters.config.AdapterConfig;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
/**
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
* @version $Revision: 1 $
*/
public class BootstrapListener implements ServletContextListener {
@Override
public void contextInitialized(ServletContextEvent sce) {
AdapterDeploymentContext deploymentContext = (AdapterDeploymentContext)sce.getServletContext().getAttribute(AdapterDeploymentContext.class.getName());
AdapterConfig config = new AdapterConfig();
config.setRealm("aerogear");
config.setResource("unified-push-server");
config.setAuthServerUrl("/auth");
config.setSslRequired(SslRequired.EXTERNAL.name());
config.setPublicClient(true);
config.setDisableTrustManager(true);
deploymentContext.updateDeployment(config);
}
@Override
public void contextDestroyed(ServletContextEvent sce) {
}
}

View file

@ -4,6 +4,7 @@
<module name="org.apache.httpcomponents"/> <module name="org.apache.httpcomponents"/>
<module name="org.codehaus.jackson.jackson-core-asl"/> <module name="org.codehaus.jackson.jackson-core-asl"/>
<module name="org.codehaus.jackson.jackson-mapper-asl"/> <module name="org.codehaus.jackson.jackson-mapper-asl"/>
<module name="org.jboss.xnio"/>
</dependencies> </dependencies>
<exclusions> <exclusions>
</exclusions> </exclusions>

View file

@ -0,0 +1,8 @@
{
"realm" : "aerogear",
"auth-server-url" : "/auth",
"ssl-required" : "external",
"resource" : "unified-push-server",
"public-client" : true,
"disable-trust-manager" : true
}

View file

@ -6,11 +6,6 @@
<module-name>aerogear-ups</module-name> <module-name>aerogear-ups</module-name>
<listener>
<listener-class>org.keycloak.example.BootstrapListener</listener-class>
</listener>
<security-constraint> <security-constraint>
<web-resource-collection> <web-resource-collection>
<web-resource-name>UPS</web-resource-name> <web-resource-name>UPS</web-resource-name>
@ -19,11 +14,6 @@
<auth-constraint> <auth-constraint>
<role-name>user</role-name> <role-name>user</role-name>
</auth-constraint> </auth-constraint>
<!--
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
-->
</security-constraint> </security-constraint>
<security-constraint> <security-constraint>
@ -34,11 +24,6 @@
<auth-constraint> <auth-constraint>
<role-name>admin</role-name> <role-name>admin</role-name>
</auth-constraint> </auth-constraint>
<!--
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
-->
</security-constraint> </security-constraint>
<login-config> <login-config>
@ -53,7 +38,4 @@
<role-name>user</role-name> <role-name>user</role-name>
</security-role> </security-role>
</web-app> </web-app>

View file

@ -33,12 +33,16 @@
<artifactId>jboss-servlet-api_3.0_spec</artifactId> <artifactId>jboss-servlet-api_3.0_spec</artifactId>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.keycloak</groupId> <groupId>org.keycloak</groupId>
<artifactId>keycloak-connections-jpa</artifactId> <artifactId>keycloak-connections-jpa</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-connections-jpa-liquibase</artifactId>
<version>${project.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.keycloak</groupId> <groupId>org.keycloak</groupId>
<artifactId>keycloak-model-jpa</artifactId> <artifactId>keycloak-model-jpa</artifactId>

View file

@ -2,10 +2,10 @@
<deployment> <deployment>
<dependencies> <dependencies>
<module name="org.apache.httpcomponents"/> <module name="org.apache.httpcomponents"/>
<module name="org.bouncycastle"/>
<module name="org.jboss.resteasy.resteasy-jackson-provider" services="import"/> <module name="org.jboss.resteasy.resteasy-jackson-provider" services="import"/>
<module name="org.codehaus.jackson.jackson-core-asl"/> <module name="org.codehaus.jackson.jackson-core-asl"/>
<module name="org.codehaus.jackson.jackson-mapper-asl"/> <module name="org.codehaus.jackson.jackson-mapper-asl"/>
<module name="org.infinispan"/>
</dependencies> </dependencies>
<exclusions> <exclusions>
<module name="org.jboss.resteasy.resteasy-jackson2-provider"/> <module name="org.jboss.resteasy.resteasy-jackson2-provider"/>
@ -16,5 +16,8 @@
<module name="org.keycloak.keycloak-undertow-adapter" /> <module name="org.keycloak.keycloak-undertow-adapter" />
<module name="org.keycloak.keycloak-as7-adapter" /> <module name="org.keycloak.keycloak-as7-adapter" />
</exclusions> </exclusions>
<exclude-subsystems>
<subsystem name="webservices"/>
</exclude-subsystems>
</deployment> </deployment>
</jboss-deployment-structure> </jboss-deployment-structure>