Okta Spring Security & Okta-Hosted Login Page Example
This example shows you how to use the Okta Spring Boot Library to login a user. The login is achieved through the Authorization Code Flow where the user is redirected to the Okta-Hosted login page. After the user authenticates, they are redirected back to the application and a local cookie session is created.
Prerequisites
Before running this sample, you will need the following:
- Java 11+
- The Okta CLI Tool
- An Okta Developer Account, create one using
okta register
, or configure an existing one withokta login
Get the Code
Grab and configure this project using okta start spring-boot
Run the Example
./mvnw spring-boot:run
For more details on how to build an application with Okta and Spring Boot / Spring Security you can read this blog post.