Giter VIP home page Giter VIP logo

node-saml's Introduction

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

node-saml's People

Contributors

go-hse avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

kavboy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.