https://github.com/pushpabrol/saml-slo-sample
https://github.com/pushpabrol/saml-slo-sample
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pushpabrol/saml-slo-sample
- Owner: pushpabrol
- Created: 2023-01-24T20:05:14.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-03T13:21:43.000Z (over 3 years ago)
- Last Synced: 2025-03-12T11:17:09.625Z (over 1 year ago)
- Language: JavaScript
- Size: 33.2 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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:
```dotenv
PORT=3001
ISSUER=saml-sp
BASEURL=
IDP_ENTRYPOINT=
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