This repository contains an example Spring Boot application that is used to demonstrate the various logout options with Spring Security and OIDC.
Please read OpenID Connect Logout Options with Spring Boot to see how this app was created.
Prerequisites:
Okta has Authentication and User Management APIs that reduce development time with instant-on, scalable user infrastructure. Okta's intuitive API and expert support make it easy for developers to authenticate, manage, and secure users and roles in any application.
To install this example, run the following commands:
git clone https://github.com/oktadeveloper/okta-spring-logout-example.git
cd okta-spring-logout-example
Log in to your Okta Developer account (or sign up if you don't have an account).
- From the Applications page, choose Add Application.
- On the Create New Application page, select Web.
- Give your app a memorable name, add
http://localhost:8080/login/oauth2/code/okta
as a Login redirect URI, select Refresh Token (in addition to Authorization Code), and click Done.
Copy the issuer (found under API > Authorization Servers), client ID, and client secret into the application.properties
of the api-gateway
and car-service
projects.
spring.security.oauth2.client.provider.okta.issuer-uri=https://{yourOktaDomain}/oauth2/default
spring.security.oauth2.client.registration.okta.client-id=$clientId
spring.security.oauth2.client.registration.okta.client-secret=$clientSecret
Then, run all the projects with ./mvnw
in separate terminal windows. You should be able to navigate to http://localhost:8080
to see the application.
These examples uses the following open source libraries:
Please post any questions as comments on the example's blog post, or on the Okta Developer Forums.
Apache 2.0, see LICENSE.