Hello everyone,
I am working on the SCIM connector from Okta and I am stuck when I deploy my connector on a tomcat. I used the Okta SDK to build the connector and I followed this guide : Create SCIM connectors for on-premises provisioning | Okta
Here is my code:
Pom.xml :
<modelVersion>4.0.0</modelVersion>
<groupId>com.okta.scim.sdk</groupId>
<version>01.03.02-SNAPSHOT</version>
<artifactId>scim-server-example</artifactId>
<packaging>war</packaging>
<properties>
<scim-server-sdk.version>[1.0,2.0)</scim-server-sdk.version>
<java.version>1.6</java.version>
<maven-jar-plugin.version>2.4</maven-jar-plugin.version>
<maven-surefire-plugin.version>2.13</maven-surefire-plugin.version>
<maven-enforcer-plugin.version>1.1.1</maven-enforcer-plugin.version>
<maven-compiler-plugin.version>2.3.1</maven-compiler-plugin.version>
<org.springframework.version>3.2.10.RELEASE</org.springframework.version>
<maven-war-plugin.version>2.2</maven-war-plugin.version>
<tomcat6-maven-plugin.version>2.1</tomcat6-maven-plugin.version>
<ch.qos.logback.version>1.1.2</ch.qos.logback.version>
<org.slf4j-api.version>1.7.10</org.slf4j-api.version>
<unboundid-scim-sdk.version>1.3.2</unboundid-scim-sdk.version>
<org.codehaus.jackson.version>1.9.13</org.codehaus.jackson.version>
<commons-io.commons-io.version>1.4</commons-io.commons-io.version>
<org.apache.httpcomponents.httpclient.version>4.3.5</org.apache.httpcomponents.httpclient.version>
<!--tests-->
<testng.version>6.8.7</testng.version>
<org.hamcrest.version>1.3</org.hamcrest.version>
</properties>
<dependencies>
<!--Okta dependencies-->
<dependency>
<groupId>com.okta.scim.sdk</groupId>
<artifactId>scim-server-sdk</artifactId>
<!--<version>01.03.02-SNAPSHOT</version>-->
<version>${scim-server-sdk.version}</version>
</dependency>
<!-- Spring dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons-io.commons-io.version}</version>
</dependency>
<!--transitive dependencies that are also needed-->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-api.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${ch.qos.logback.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>${ch.qos.logback.version}</version>
</dependency>
<dependency>
<groupId>com.unboundid.product.scim</groupId>
<artifactId>scim-sdk</artifactId>
<version>${unboundid-scim-sdk.version}</version>
<exclusions>
<exclusion>
<artifactId>servlet-api</artifactId>
<groupId>org.mortbay.jetty</groupId>
</exclusion>
<exclusion> <!-- Exclude httpclient, unboundid uses older - 4.0.1-->
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>${org.codehaus.jackson.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${org.apache.httpcomponents.httpclient.version}</version>
</dependency>
<!--Tests-->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>${testng.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>${org.hamcrest.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<useFile>false</useFile>
<trimStackTrace>false</trimStackTrace>
<excludes>
<exclude>**/*FuncTest.java</exclude>
</excludes>
<failIfNoTests>false</failIfNoTests>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<useFile>false</useFile>
<trimStackTrace>false</trimStackTrace>
<includes>
<include>**/*FuncTest.java</include>
<include>**/*IT.java</include>
</includes>
<failIfNoTests>false</failIfNoTests>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat6-maven-plugin</artifactId>
<version>${tomcat6-maven-plugin.version}</version>
<configuration>
<port>2081</port>
<path>/scim</path>
</configuration>
<executions>
<execution>
<id>start-tomcat</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<fork>true</fork>
<port>2081</port>
<path>/scim</path>
</configuration>
</execution>
<execution>
<id>stop-tomcat</id>
<phase>post-integration-test</phase>
<goals>
<goal>shutdown</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>${maven-enforcer-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${maven-war-plugin.version}</version>
<configuration>
<attachClasses>true</attachClasses>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
testScim.java :
import com.okta.scim.server.capabilities.UserManagementCapabilities;
import com.okta.scim.server.exception.DuplicateGroupException;
import com.okta.scim.server.exception.EntityNotFoundException;
import com.okta.scim.server.exception.OnPremUserManagementException;
import com.okta.scim.util.model.*;
public class testScim implements com.okta.scim.server.service.SCIMService {
@Override
public SCIMUser createUser(SCIMUser scimUser) throws OnPremUserManagementException {
return null;
}
@Override
public SCIMUser updateUser(String s, SCIMUser scimUser) throws OnPremUserManagementException, EntityNotFoundException {
return null;
}
@Override
public SCIMUserQueryResponse getUsers(PaginationProperties paginationProperties, SCIMFilter scimFilter) throws OnPremUserManagementException {
return null;
}
@Override
public SCIMUser getUser(String s) throws OnPremUserManagementException, EntityNotFoundException {
return null;
}
@Override
public SCIMGroup createGroup(SCIMGroup scimGroup) throws OnPremUserManagementException, DuplicateGroupException {
return null;
}
@Override
public SCIMGroup updateGroup(String s, SCIMGroup scimGroup) throws OnPremUserManagementException, EntityNotFoundException {
return null;
}
@Override
public SCIMGroupQueryResponse getGroups(PaginationProperties paginationProperties) throws OnPremUserManagementException {
return null;
}
@Override
public SCIMGroup getGroup(String s) throws OnPremUserManagementException, EntityNotFoundException {
return null;
}
@Override
public void deleteGroup(String s) throws OnPremUserManagementException, EntityNotFoundException {
}
@Override
public UserManagementCapabilities[] getImplementedUserManagementCapabilities() {
return new UserManagementCapabilities[0];
}
}
dispatcher-servlet.xml
<!--this is the required spring configuration file that is included within the scim-server-sdk jar-->
<import resource="classpath:opp-sdk-config.xml"/>
<bean id="service" class="testScim">
<!--The SDK ships with the sample users.json and groups.json in the src/main/resources directory. Provide the absolute path to these files below. Edit these files with the users/groups you want to be imported into Okta.
If you do not want to store any data in files, you can leave the value for these property empty-->
<property name="usersFilePath" value=""/>
<property name="groupsFilePaths" value=""/>
</bean>
When I build my .war and try to deploy it in tomcat, I get the following error: FAIL - Application at context path [/scimServer] could not be started.
If I ask around, it seems that the problem comes from my bean and indeed, I had forgotten to configure the two properties of my bean.
The questions are :
Where does my problem come from?
And What should I replace usersFilePath and groupsFilePath with ?
Thank you,
sorry for my poor English