Giter Site home page Giter Site logo

seifeldeen92 / react-okta-saml Goto Github PK

View Code? Open in Web Editor NEW
23.0 1.0 3.0 153 KB

Simple Okta SAML authentication with React client

HTML 16.36% TypeScript 80.16% CSS 3.48%
react okta okta-api okta-react passport passport-session express express-session expressjs typescript passport-saml

react-okta-saml's Introduction

Simple React and Express app SAML login by Okta

This is a very simple integration to demonstrate SSO via SAML Okta

Features

  • Save user if authenticated
  • Redirect user to Okta login if user not authenticated to access our app

Tech

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

Installation

App requires Node.js v10+ to run.

Install Server

Install the dependencies and devDependencies and start the server on port 5000.

cd server
yarn install
yarn dev

in another terminal window

cd server
yarn watch

Install Client

Install the dependencies and devDependencies and start the client on port 3000.

cd client
yarn install
yarn start

Setup Okta App

Go to Okta developer and signup or signin. After you signin, you need to create an application from the left sidebar.

How to Configure SAML 2.0 for your Application

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.

Reference

Congratulation! you are done! ๐Ÿฅณ

react-okta-saml's People

Contributors

seifeldeen92 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

react-okta-saml's Issues

Couldnt Compile with Node 17.4.0

node:internal/modules/cjs/loader:488
throw e;
^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in /Users/chinna/Downloads/React-Okta-SAML-master/client/node_modules/postcss-safe-parser/node_modules/postcss/package.json
at new NodeError (node:internal/errors:371:5)
at throwExportsNotFound (node:internal/modules/esm/resolve:429:9)
at packageExportsResolve (node:internal/modules/esm/resolve:703:3)
at resolveExports (node:internal/modules/cjs/loader:482:36)
at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (/Users/chinna/Downloads/React-Okta-SAML-master/client/node_modules/postcss-safe-parser/lib/safe-parser.js:1:17) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

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.