This repository contains a small demo about how to authenticate a java client application with OpenID Connect and the OAuth2 Authorization Code Flow with PKCE.
It was part of my Talk at the JUG Nürnberg. The slides are available on SlideShare:
- Start keycloak locally using docker or podman as described in the Keycloak documentation: https://www.keycloak.org/getting-started/getting-started-docker#_start_keycloak
- Login into the admin console
- Create a new OIDC Client named
java-demo
: and - Add the redirect uri
http://localhost:*
:
Run the class de.chrfritz.oidc.auth.CliTestClient
in src/test/java
. The example shows the
Run-Configuration for IntelliJ:
Then a browser window should be opened: After a successful login, you should see that the demo got a valid access token and got the information from the user info endpoint:
Christian Fritz (@chrfritz), christian.fritz@qaware.de
This software is provided under the MIT open source license, read the LICENSE
file for details.