A quick and easy example of how to use OpenId Connect to integrate a spring application with FusionAuth.
This repository is no longer maintained. For a modern example of integrating Spring and FusionAuth, please see https://github.com/FusionAuth/fusionauth-example-java-spring
- Download and install FusionAuth
- Create an Application
- While you are creating an application, create two roles user and admin
- Add a valid redirect URL to your OAuth configuration. For this example use
http://localhost:8081/login
. - Add
http://localhost:8081/logout
as the logout url. - Click save (blue icon at the top right)
- Copy
application-example.properties
toapplication.properties
- Copy your Client id and Client secret from the Application configuration into
application.properties
under thefusionAuth.clientId
andfusionAuth.clientSecret
properties (respectively). - Copy your FusionAuth Application ID into
fusionAuth.applicationId
- Modify the existing
localhost:9011
urls to be the location of your fusion auth instance if it is not running locally. - Start the example with
mvn spring-boot:run
and navigate to http://localhost:8081
For an in depth explanation and tutorial checkout our blog.
Some portions of this code were forked/based on the code available here: https://github.com/eugenp/tutorials which are licensed under MIT. The full license is available under LICENSE.