Skip to content

go-hse/node-saml

Repository files navigation

ID-Management with Keycloak and Node.js

Prerequistes

  1. Linux OS with 4 GB RAM preferred - may work with Windows, too, but is not tested
  2. Install docker and docker-compose
  3. openssl for generation of certificates
  4. Install Node.js for Testing

SAML with Keycloak

  1. Start containers:
docker-compose up -d
  1. Open Admin-Console

http://localhost:8080/auth/

Problems with HTTPS?

see: https://stackoverflow.com/questions/30622599/https-required-while-logging-in-to-keycloak-as-admin

docker exec -it {containerID} bash
cd /opt/jboss/keycloak/bin
./kcadm.sh config credentials --server http://localhost:8080/auth --realm master --user admin
./kcadm.sh update realms/master -s sslRequired=NONE

User: admin, Password: admin (same as in docker-compose.yml, should be changed)

  1. Configure Keycloak
  1. Generate Key and Cert with makecerts.sh

The password should be changed in file <projectdir>/P12phrase These keys/certs are stored in <projectdir>/certs

Upload the cert <projectdir>/certs/client.p12 to Keycloak: Keycloak - clients - keys - import PKCS12 - keyAlias samlKey - password: from <projectdir>/P12phrase

  1. Add users (see Manage Users)

  2. Login to Keycloak as User

  1. Open WebApp
# install node dependancies
npm i

# start node web server
node app.js

SUCCESS!

Useful Commands:

# Stop docker containers
docker-compose down

# list all containers
docker ps –a

# remove container
docker rm <container-id>


# list images
docker image ls

# remove image
docker rmi image-id

To Reset:

  • Remove containers
  • Remove DB in directory ./.mysql-data

Credits/Sources:

Node/Express-App from https://codeburst.io/keycloak-and-express-7c71693d507a

Links

https://www.keycloak.org/docs/latest/getting_started/index.html

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors