Git Product home page Git Product logo

saml-slo-sample's Introduction

Sample passport saml app with SLO with Auth0

This project uses passport-saml and auth0 to demonstrate SP Initiated SLO with Auth0

Requirements

  • node.js
  • express
  • passport saml
  • auth0 tenant with an application and a connection enabled

Used middlewares

  • passport
  • express cookie
  • express session
  • morgan

Auth0 Setup

  • Create an Auth0 tenant
  • Create an application of type Regular Web Application
  • Go to the addons tab
  • Click on the SAML2 WEB APP and then click on settings
  • Set the Application callback url - BASEURL/login/callback where BASEURL is the same as the BASE url of the app you set in the .env file below
  • Set the settings as
    {
        "mapUnknownClaimsAsIs": true,
        "passthroughClaimsWithNoMapping": true,
        "logout": {
            "callback": "BASEURL/singlelogout",
            "slo_enabled": true
        },
        "binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
    }
    
  • Scroll to the bottom of this dialog and click "Save" and then close the dialog
  • Make sure your application has at least one connection enabled
    • Click on the application's Connections tab and enable the connection you would like to use for this application

ENV

Before running the app, you should create your own .env file in the root with the following variables:

PORT=3001
ISSUER=saml-sp
BASEURL=<apps base url>
IDP_ENTRYPOINT=<SAML IDP url. You get this value from the Auth0 apps SAML Addon's Usage page>
IDP_SIGNING_CERT_STR="The IDP signing certificate with newlines removed and the -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- stripped out"
SESSIONSECRET=This is a great big secret for the session

Running

* Make sure you have set the .env file and completed the Auth0 Setup
  • npm install
  • npm start
  • open browser at BASEURL and click on login
  • Once logged in see the SAML Assettion and scroll to the bottom of the page and click logout to see the SLO flow

saml-slo-sample's People

Contributors

pushpabrol avatar

Watchers

James Cloos avatar

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.