Skip to content
This repository has been archived by the owner on Aug 4, 2020. It is now read-only.

ruines/express-keycloak-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo for Keycloak using express backend

Run Keycloak

$ sudo docker run -d -p 8080:8080 \
    -e KEYCLOAK_USER=admin \
    -e KEYCLOAK_PASSWORD=admin \
    quay.io/keycloak/keycloak:10.0.2

Setup Keycloak

  • Login to Keycloak admin panel and create a client with using the provided example_client.json file.
  • Create a normal user.
  • Admin user has realm admin role already.
  • Setup public key in utils.js for the client.

Run server

Need nodejs>=10

Install packages:

$ npm i

Run the node server:

$ npm start

Server runs on port 3000.

Notes

  • DONOT set all requests under Realm Settings > Login > Require SSL. Use proxy SSL termination.
  • Currently using openid-connect for client.
  • implicit flow uses reponseType as token id_token, explicit uses code.
  • In "Mappers" of a client, "Attributes" of a user can be set as token values.

About

Keycloak demo with express backend

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published