- Go to GitHub profile settings and create a new OAuth app.
- Generate client secret
- Set authorization callback URL to:
http://localhost:8080/realms/demo/broker/github/endpoint
, and home page URL to:http://localhost:3000
- Rename the
.example.env
file to.env
- Copy
Client ID
as set it asGITHUB_APP_CLIENT_ID
in the.env
file - Click on
Generate a new client secret
copy the secret and set asGITHUB_APP_CLIENT_SECRET
in the.env
file
Run keycloak:
docker compose up -d --wait
Install the dependencies and run the complete example in one command:
npm install && npm start
On the NextJS frontend, click the "Login" button. Once the login is complete, the Frontend will automatically fetch the data and inject the bearer token into the origin request.
Keycloak console user name: admin, password: admin
Read the Docs.
Join us on Discord!