GithubHelp home page GithubHelp logo

spring-security-saml2-okta's Introduction

A simple example of using okta for authentication with Spring Security SAML and Spring Boot.

Setup

JDK 7+ Installed

The application requires you have JDK7+ installed on your computer.

Okta Setup

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 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
$ ./mvnw spring-boot:run
Run on Windows
$ .\mvnw.cmd spring-boot:run

Once the application starts:

Authenticating with a local account

You can authenticate with a local account using:

  • Username user

  • Password password

  • Press Log in

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:

  • Select Okta radio button

  • Press Start single sign-on button

You should now see the user name displayed

spring-security-saml2-okta's People

Contributors

ggonchar avatar rwinch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

spring-security-saml2-okta's Issues

Spring Boot and Spring Security SAML

Not a real issue.
Just found this sample for SAML+Okta and wanted to share this other one with the same purpose. It uses a custom built plugin to avoid the boiler plate and xml config of Spring Security SAML. Pointers are welcome!

An Authentication object was not found in the SecurityContext

Hi Team,

I am facing this issue while runnig this project. I have followed all the steps and configured with okta account. I am able to login and logout using Okta account. But this error comes in the logs. Whenever i start the project and hit localhost:8080 this error occurs. Also i want to integrate it with WSO2 identity server and WSO2 identity server will have multiple identity providers associated with this. I have added WSO2 metadata and able to redirect it to Okta. But the same error occurs and i got redirected to login page again without other errors.

The error is like "org.springframework.security.authentication.AuthenticationCredentialsNotFoundException: An Authentication object was not found in the SecurityContext"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.