Okta SAML SSO for Spring Boot Web Application

Hi Everyone,
From past one week am working on this feature, But I couldn’t find the solution

Feature: Providing the SSO Feature to My WebApp (My Web Application need to Access from OKta)

So Okta will initiate the Login flow, I need to capture the Access token and validate it and authorize user to login to the Web Application.

Following are the dependencies I have added to work

org.springframework.security.extensions spring-security-saml-dsl 1.0.0.M3
          <dependency>
                 <groupId>com.okta.spring</groupId>
                 <artifactId>okta-spring-boot-starter</artifactId>
                 <version>1.1.0</version>
          </dependency>

         <dependency> <groupId>org.springframework.security.oauth</groupId> 
                 <artifactId>spring-security-oauth2</artifactId> 
          </dependency>

Backend Code used this link reference but no luck !!

Can you help me with the piece of working code or Reference links which will really helpful to me !

As you can probably see, most posts in this deserted forum have zero replies. Okta simply doesn’t care about support, sorry to say but you’re on your own.

1 Like

Hi @prasad_okta

The link that you mentioned also provides a reference to one of the GitHub repositories of the author which contains the source code for the application, https://github.com/oktadeveloper/okta-spring-boot-oauth-example.

If you have tried this and received an error, please send us an email to developers@okta.com and one of our engineers will further assist you in resolving the issue that you are experiencing.

hi @dragos
I tried this example, but this is not my requirement.
I have created a SAML 2.0 application in Okta and wanted provide SSO feature to My Web Application. In most of the references am getting OAuth SSO examples (which is Login with Okta).

I need to capture the SAML POST response and maintain the Session for the user who clicked on MyApp.

<< Attached screenshot for your reference >>

please go through below link , it worked for me

GitHub : https://github.com/Java-Techie-jt/spring-boot-okta-sso

My YouTube tutorial : https://youtu.be/yB9kEMx7fxE

hi @Basant
Thanks for the response,
In your example you have created the Application as Web Application.
I have created as SAML 2.0 Application which will connect to My Web App and Post the SAML Response. that i need to capture and before it redirected to Home page i will check in my database and based on the user role will redirect to authorized page.

So here am unable to get the SAML POST response !
What Okta SAML expecting from My Web App ?

Hi @prasad_okta , i didn’t work on SAML but you can refer below source code it may help you https://github.com/talk2amareswaran/Spring-Boot-SAML-and-OKTA

let me know if you want me to try this usecase

hello @Basant,

I will try this out and let me know if this solve the issue !