See corresponding tutorial here.
node.js
(I used v13.14.1)yarn
ornpm
- Register your app with an IdP.
- Fill in the following constants in
./server/src/constants.js
in order to point to your IdP.SAML_SSO_URL
SAML_ACS_URL
SAML_CERT
- Navigate to
./dashboard
. - Run
yarn install
to install necessary packages for React rendering. - Run
yarn start
and navigate tohttp://localhost:8080/
to test the client-side app. User data should fail to fetch. Stop the command. - Run
yarn build
to bundle the app using Webpack. This will create the folder./server/public
. - Navigate to
./server
. - Run
yarn install
to install necessary packages for React rendering. - Deploy the server package (
./server
) somewhere that will give you a publicly accessible URL. - Set
REDIRECT = false
in./server/src/routes/saml.js
. - Run
yarn start
and navigate tohttp://localhost:9090/
to test the served react app. You should be redirected to login through the IdP, and then redirected back to yourlocalhost
app once completed.
- I chose to use the server to access the user's cookies instead of letting the client. This is safer because it helps protect against XSS attacks.