Giter Site home page Giter Site logo

saml-singlesignon's Introduction

#Single SingleOn: Service Provide (SP) Client

Pre-requisite

Ensure below tools are installed in your environment as those are mandatory to run the client app.

NodeJs

https://nodejs.org/en/download/

Docker (incase to deploy app in container)

https://www.docker.com/get-started/

Open SSL

https://www.openssl.org/source/

Usage

Clone the source code over https

git clone https://github.com/codeadhoc/SAML-SingleSignOn.git

Generate Self-Sign SSL Certificate to run the app in HTTPS mode

openssl req -newkey rsa:2048 -nodes -keyout {private_key_name}.key.pem -x509 -days 3650 -out {public_certi_name}.cert.pem

Configurations

Navigate to sp-pub-cert.pem and replace the string from newly generate {public_certi_name}.cert.pem and sp-pvt-key.pem string with {private_key_name}.key.pem

Navigate to App.js and update the configures as per IDP provider you're using

/** SAML Configurations attributes 
* callbackurl : apps url for IDP to response post authentication 
* signout: apps url for IDP to notify app post sign out 
* entrypoint: IDP url to redirect for authentication 
* entityId : Apps Id 
*/ 
const samlConfig = {
  issuer: "Client-ID", 
  entityId: "realm name/entity name", 
  callbackUrl: "https://{IP-Address}:{PORT}/login/callback", 
  signOut: "https://{IP-Address}:{PORT}/signout/callback", 
  entryPoint: "{saml 2.0 login Url}"
};

Run app in container

Build Docker Image

docker build -t ImageName:TagName dir

Run in Container

docker run --name <name-of-container> -p <hostport>:<containerport> -d <image-name>

Run locally Non-Container

//install dependency module
npm install 

//ensure it app root directory
node app.js
  • Go the browser and navigate to home page : http://localhost:8080/
  • Navigate to login page: http://localhost:8080/login app will redirect to IDP for login process and post login it will redirect to call back url with SAML assertion token with claims container user details

License

MIT

saml-singlesignon's People

Contributors

codeadhoc avatar

Stargazers

Stephen Taes avatar Ajiyba Nesij avatar Jorden Liu Chin Hao avatar Andrés G. Carmona avatar Nguyen Tran avatar Parag Patil avatar Connie Leung avatar Matheus Azambuja avatar

Watchers

 avatar

saml-singlesignon's Issues

Bad Decrypt Error

When I run the node app I get the following error:

node:internal/tls/secure-context:92
  context.setKey(key, passphrase);
          ^

Error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt
    at setKey (node:internal/tls/secure-context:92:11)
    at configSecureContext (node:internal/tls/secure-context:174:7)
    at Object.createSecureContext (node:_tls_common:121:3)
    at Server.setSecureContext (node:_tls_wrap:1353:27)
    at Server (node:_tls_wrap:1212:8)
    at new Server (node:https:73:3)
    at Object.createServer (node:https:109:10)
    at Object.<anonymous> (/home/ec2-user/node-app/app.js:216:22)
    at Module._compile (node:internal/modules/cjs/loader:1155:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10) {
  opensslErrorStack: [ 'error:0906A065:PEM routines:PEM_do_header:bad decrypt' ],
  library: 'digital envelope routines',
  function: 'EVP_DecryptFinal_ex',
  reason: 'bad decrypt',
  code: 'ERR_OSSL_EVP_BAD_DECRYPT'
}

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.