An OpenID Connect client using Spring Security and the Google Identity Platform.
MIT License
A simple demo of an OpenId Connect client using Spring Security and Spring OAuth2 to authenticate with the Google Identity Platform.
application.properties.template
to application.properties
.application.properties
file.google.openidconnect.optional.scopes
in application.properties
as required.mvn clean install
mvn spring-boot:run
http://localhost:8080
Once you've authenticated with Google and authorized the app, you should get redirected to the Homepage:
Secured Homepage
UserId: ALongNumber
Email: <username>@gmail.com
It's worth taking a look at the browser network tab to see the OpenID Connect interactions. The app console log dumps out some useful stuff too, e.g. token details and user info.
A bare-bones integration test is included and can be run as part of the build. To do this:
mvn spring-boot:run
mvn verify -Dskip.integration.tests=false
This app was inspired by the excellent tutorial written by eugenp. The integration test originated from code written by fromi.