You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This node.js web application demonstrates SSO authentication provided by RIT's Shibboleth Server (https://shibboleth.main.ad.rit.edu/), using the `passport-saml` package.
3
+
This Node.js web application demonstrates SSO authentication provided by BU's Shibboleth Server using the `passport-saml` package.
4
4
5
5
Config
6
6
======
7
-
8
-
This app requires 3 files to be placed in a folder named `cert` located in the project's root directory. These files include (1) the certificate of the Identity Provider (IdP). In this case, RIT's Shibboleth Server is the IdP. As a Service Provider (SP), you need to generate your own (2) certificate and (3) private key. These files are named as follows:
7
+
In order to use Shibboleth authentication, your application requires a certificate/private key pair, as well as BU's Shibboleth Identity Provider (IdP) Certificate. The files should be named as such:
9
8
10
9
-`cert.pem`: SP's certificate (Generated by you)
11
-
-`cert_idp.pem`: IdP's certificate (RIT's is contained in https://shibboleth.main.ad.rit.edu/rit-metadata.xml)
12
10
-`key.pem`: SP's private key (Generated by you)
11
+
-`cert_idp.pem`: IdP's certificate (BU's is contained in https://shib-test.bu.edu/idp/shibboleth)
12
+
13
+
Alternatively, instead of storing the certificates in files, they can be stored as environment variables. Simply collapse the contents of each file into one line, inserting `\n` for line breaks, and then store them in your `.env` file. This can be useful when running your application on a service like Heroku and you want to minimize the number/size of files uploaded, or you are not allowed to upload extra files, etc.
13
14
14
15
Creating Private Key and Certificates
15
16
=====================================
16
-
17
-
Generate the SP files with the following command:
17
+
Generate your certificate/private key files with the following command:
The IdP Certificate is contained within the `ds:X509Certificate` tag.
20
+
The [IdP Certificate](https://shib-test.bu.edu/idp/shibboleth) is contained within the `ds:X509Certificate` tag.
21
21
- Copy the tag's contents into a file named `cert_idp.pem`.
22
22
23
-
Next, copy `.env.sample` to `.env` and edit appropriately. Running this app locally will likely not work since the IdP can't redirect to `localhost`.
23
+
Next, copy `.env.example` to `.env` and edit appropriately. Running this app locally will likely not work since the IdP can't redirect to `localhost`.
24
24
25
25
Registering the Service Provider
26
26
================================
27
-
28
-
Contact ITS to register your Service Provider. During this step, the IdP Administrator downloads the metadata from the `/Shibboleth.sso/Metadata` endpoint and loads it into the IdP.
27
+
Fill out BU's [Service Provider Checklist](https://www.bu.edu/tech/services/security/iam/authentication/shibboleth/service-provider-checklist/) form to register your application (for the "Service Provider Metadata" textbox, go to your app's `/shibboleth/metadata` route and copy the entire XML content into the textbox). After a few days, it will be processed and your authentication setup will be live!
29
28
30
29
Usage
31
30
=====
32
-
33
31
```
34
-
npm install
35
-
node app.js
32
+
yarn install
33
+
yarn start
36
34
```
37
35
36
+
Shoutout to Dharmesh Tarapore's [BU Shibboleth guide](https://cs-people.bu.edu/dharmesh/teaching/shibboleth/) for Apache, it was very useful in figuring out the BU specific configuration for `passport-saml`. Another shoutout to the [RIT Student Goverment](https://github.com/ritstudentgovernment), who's repo we forked.
0 commit comments