Introduction
springboot-saml-okta is a Spring Boot application to demonstrate the Single Sign On process with SAML(Security Assertion Markup Language) and OKTA
This application provides you with an example of Sign in with the db and also sign it with SSO via Okta using SAML
Getting Started
Before Starting you need to create an OKTA account using okta.com/integrate/signup
Once you are in using Google Sign-in create a new Application(Create a new app integration)
From the options use the option SAML 2.0 and next
In the General Setting give the application name and click next
Now you are in configure SAML page in Single sign on URL option put http://localhost:8080/saml/SSO and in Audience URI put http://localhost:8080/saml/metadata and next
Once done then select the first radio button I'm an Okta customer adding an internal app
And the checkbox This is an internal app that we have created and Finish
Now your application is successfully created now go to sign on tab and copy the Identity Provider Metadata URL and put in application.properties under saml.metadataUrl
Then go to View Setup Instructions and copy Identity Provider Issuer and put under saml.idp inside application.properties file
Inside application.properties there is one property which is saml.sp there you need to give http://localhost:8080/saml/metadata
Here the OKTA setup is finished
KeyStore Setup
i) For Setting up Key Store please navigate to src/main/resources/saml folder.
ii) Here in this folder keystore command is not recognized, so you need to set here the JRE path.
iii) In Intellij idea terminal now you are inside SAML folder type "set PATH=C:\Program Files\Java\jre1.8.0_281\bin" and press enter.
iv) Once done you need to use the below command
v) "keytool -genkey -v -keystore keystore.jks -alias springoktasaml -keyalg RSA -keysize 2048 -validity 10000"
v) Give the password as secret Hit Enter and Enter finally just enter yes and give the password
vi) Now with the keytool command we need to take the alias name which is springoktasaml and configure in saml.keystore.alias property
vii) Then the password which is secret and configure in saml.keystore.password and finally the saml.keystore.location as "classpath:/saml/keystore.jks"