rwinch / spring-security-saml2-okta

5 stars 8 forks source link

A simple example of using okta for authentication with http://projects.spring.io/spring-security-saml/[Spring Security SAML] and http://projects.spring.io/spring-boot/[Spring Boot].

= Setup

== JDK 7+ Installed

The application requires you have http://openjdk.java.net/install/[JDK7+ installed] on your computer.

== Okta Setup

https://www.okta.com/developer/signup/[Create an Okta developer account] if you do not already have one. You will receive an email to instructions for setting up your test identity provider.

Follow the directions under the http://developer.okta.com/docs/guides/spring_security_saml.html#configuring-okta-to-work-with-spring-security-saml[Configuring Okta to work with Spring Security SAML]. The difference is that you will use the following values:

== Spring Security SAML Configuration

.src/main/resources/application.properites

TBD Enter the Identity Provider metadata link from Okta

security.saml.idp.metadata=https://example.okta.com/app/abc0defghijK1lmN23o4/sso/saml/metadata

== Running the Sample

You can now run the sample using:

.Run on OSX or *nix [source,bash]

$ ./mvnw spring-boot:run

.Run on Windows [source,bash]

$ .\mvnw.cmd spring-boot:run

Once the application starts:

=== Authenticating with a local account

You can authenticate with a local account using:

You should now see the user name displayed.

=== Logging Out

You can log out using the Log Out button. This will trigger Single Logout process

=== Authenticating with Okta

You can perform Single Sign On with Okta:

You should now see the user name displayed