# Spring-security-saml-dsl without Spring Boot

**URL:** <https://devforum.okta.com/t/spring-security-saml-dsl-without-spring-boot/617>\
**Category:** SAML\
**Tags:** java, saml\
**Created:** [October 20, 2017, 4:24pm UTC](https://devforum.okta.com/t/spring-security-saml-dsl-without-spring-boot/617 "2017-10-20T16:24:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fleeva](https://avatars.discourse-cdn.com/v4/letter/f/22d042/32.png) [@fleeva](https://devforum.okta.com/u/fleeva)\
**Post date:** [October 20, 2017, 4:24pm UTC](https://devforum.okta.com/t/spring-security-saml-dsl-without-spring-boot/617/1 "2017-10-20T16:24:22Z")

</div>

I’ve got this example to work. [Get Started with Spring Boot, SAML, and Okta | Okta Developer](https://developer.okta.com/blog/2017/03/16/spring-boot-saml)

I have an legacy app that I would like to secure the REST endpoints. Backend is a standard Springframework app that is deployed to Tomcat.

Have anyone gotten it to work?

I’ve got it mostly working, app allows me to login through Okta then I am getting this error  
**HTTP Status 401 - Authentication Failed: Incoming SAML message is invalid**

I believe the error is from SAMLProcessingFilter.java → SAMLProcessorImpl.java line 105.

Am I missing some configuration or some dependency?

I am using the SecurityConfiguration.java from the example.

Here is a web.xml:

```
<servlet>
    <servlet-name>rest</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
    <servlet-name>rest</servlet-name>
    <url-pattern>/resources/*</url-pattern>
</servlet-mapping>

<filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

```

Here is the applicationsContext.xml

```
<context:annotation-config/>
<context:component-scan base-package="com.example"/>
<context:component-scan base-package="org.springframework.security.saml"/>
```

---

<div class="post-metadata">

**Author:** ![mtl0612](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@mtl0612](https://devforum.okta.com/u/mtl0612)\
**Post date:** [May 29, 2019, 5:52pm UTC](https://devforum.okta.com/t/spring-security-saml-dsl-without-spring-boot/617/2 "2019-05-29T17:52:28Z")

</div>

Can you share what you have done to get spring-security-saml-dsl to work without spring boot to authenticate users with Okta? We also have legacy spring apps with spring mvc/jsp. Examples are much appreciated!

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [January 17, 2024, 11:36pm UTC](https://devforum.okta.com/t/spring-security-saml-dsl-without-spring-boot/617/3 "2024-01-17T23:36:36Z")

</div>

Closed on January 17, 2024, 11:36pm UTC


