1

I can't seem to get saml2 working. Here is what I have done.

I downloaded the sample application from here: https://github.com/spring-projects/spring-security-saml, this was a link from their documentation: http://docs.spring.io/spring-security-saml/docs/1.0.x/reference/html/chapter-quick-start.html

1) converted the sample application 'saml2-sample' into an eclispe project: mvn eclipse:eclipse

2) built the project: mvn package

3) added the 'Dynamic Web Module` facet to the project:

Right Click on project > Properties > Project Facets

4) Run the application on the STS Server:

Right Click on project > Run As > Run on Server

Server starts up and everything looks ok in the console except the url loads with HTTP Status 404 - /spring-security-saml2-sample/ at the URL http://localhost:8080/spring-security-saml2-sample/

Vladimír Schäfer
  • 15,375
  • 2
  • 51
  • 71
jax
  • 37,735
  • 57
  • 182
  • 278

2 Answers2

0

Please, follow these steps:

  • Download the project from Github as archive.
  • Unzip the archive.
  • By STS/Eclipse: File > Import > Existing Maven Projects and select as root dir {your_download_folder}/spring-security-saml-master/sample folder.

Now, you may see these errors:

err-1

err-2

  • Fix the pom.xml as shown in this gist.
  • In the end, you may also fix the MetadataController class (note that some methods have changed between versions).

err-3

The easiest way is to remove that class, otherwise you should fix it manually.

  • Finally, run the project as webapp.

That's all!


Annotation-based configuration

If you would like to use an annotation-based configuration, you could see this one: spring-boot-security-saml-sample.

vdenotaris
  • 13,297
  • 26
  • 81
  • 132
0

The try to change the Spring Framework dependency to latest version's like 3.2.13 or 4.0.9. I'm able to run the application successfully with both of these dependencies. Also when you're updating spring dependencies, please make sure to change xsd version to what you're using spring version "securityContext.xml" and "saml-servlet.xml". Fyi - I've use following versions in a pom.xml file

<properties>
        <junit.version>4.12</junit.version>
        <jsp-api-version>2.0</jsp-api-version>
        <spring.version>4.0.9.RELEASE</spring.version>
        <spring.security.version>3.2.5.RELEASE</spring.security.version>
        <spring-security-saml2-core-version>1.0.0.RELEASE</spring-security-saml2-core-version>
        <slf4j-log4j12-version>1.7.10</slf4j-log4j12-version>
        <jstl.version>1.2</jstl.version>
</properties>
PAA
  • 1
  • 46
  • 174
  • 282