This is a demo application using Proof Key Code Exchange (https://oauth.net/2/pkce/) to ask for authorization to read the users e-mail address at the chess site Lichess (https://lichess.org/).
Launching the application will start a Web Browser which the user can use to choose to authorize this demo application to read the e-mail address. This flow can be used to implement applications wanting to use authenticated endpoints of the Lichess API (https://lichess.org/api)
Make sure to use at least Java 11,
$ java -version
openjdk version "11.0.24" 2024-07-16
OpenJDK Runtime Environment Temurin-11.0.24+8 (build 11.0.24+8)
OpenJDK 64-Bit Server VM Temurin-11.0.24+8 (build 11.0.24+8, mixed mode)
Run with following command
$ java LichessPKCE.java