Skip to content

lukeddy/stormpath-spring-boot-mfa-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Stormpath is Joining Okta

We are incredibly excited to announce that Stormpath is joining forces with Okta. Please visit the Migration FAQs for a detailed look at what this means for Stormpath users.

We're available to answer all questions at [email protected].

Stormpath Spring Boot MFA Example

This example demonstrates a flow where an multi-factor authentication (MFA) confirmation is required after each login and before gaining access to protected pages.

In particular, it uses TOTP for MFA. And, it uses The Google Authenticator QR Code to set the shared secret. So, you'll want to grab a Google Authenticator compliant app for your smart phone.

TL;DR:

  1. Register for Stormpath
  2. Save your apiKey file (Found by following the Manage API Keys link in the admin console) to: ~/.stormpath/apiKey.properties
  3. mvn clean install
  4. mvn spring-boot:run
  5. Browse to: http://localhost:8080

Note: Multi-Factor Authentication is only available with paid Stormpath plans. For more information please see Stormpath’s Pricing Page.

You can see this example in action at https://stormpath-mfa-example.herokuapp.com

The flow looks like this:

mfa login flow

The diagram above is not as complex as it may seem. You can think of the left and right sides as two different flows.

On the right side of the diagram, the user has not logged in yet.

On the left side of the diagram, the use has already logged in.

Both flows ensure that (a) the user sets up MFA and (b) the user has validated the latest token code after logging in, but before getting to an authenticated page.

This example takes advantage of Stormpath's postLoginHandler that all of our integrations support.

Here's the typical flow:

  1. Home Page - Unauthenticated

    home page unauth

  2. Login

    login

  3. Create Google Authenticator MFA

    create ga mfa

  4. Verify MFA Code

    verify ga code

    ga app

  5. Home Page - Authenticated

    home page auth

  6. Logout

    home page unauth

  7. Login

    login

  8. Confirm Latest MFA code (No QR Code this time)

    confirm mfa code

  9. Home Page - Authenticated

    home page auth

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 57.9%
  • HTML 42.1%