This is a very simple integration to demonstrate SSO via SAML Okta
- Save user if authenticated
- Redirect user to Okta login if user not authenticated to access our app
This project uses:
- React - For the client side
- node.js - Evented I/O for the backend
- Express - node.js framework
- Passport - Authentication middleware for our API
- Passport SAML - This is a SAML 2.0 authentication provider for Passport
App requires Node.js v10+ to run.
Install the dependencies and devDependencies and start the server on port 5000.
cd server
yarn install
yarn devin another terminal window
cd server
yarn watchInstall the dependencies and devDependencies and start the client on port 3000.
cd client
yarn install
yarn startGo to Okta developer and signup or signin. After you signin, you need to create an application from the left sidebar.
Single sign on URL: http://localhost:5000/login/callback
Audience URI (SP Entity ID): http://localhost:5000
Name ID format: EmailAddress
Application username: Okta username
After you finish this step, you will need to copy Identity Provider Single Sign-On URL and X.509 Certificate found after you click on View Setup Instructions.Afterwards, add your copied Identity Provider Single Sign-On URL to the entryPoint property in config.ts under saml property, then add your application's X.509 Certificate in saml.pem.
- Okta developer docs
- React SAML Authentication by @joeythelantern 🙏 Thank You
Congratulation! you are done! 🥳