Code Monkey home page Code Monkey logo

react-samlify's Introduction

react-samlify

Disclaimer: This repository provide a minimal implementation for SAML based login with Okta identity provider. Therefore, it is not a production ready implementation especially the handling of storing token and user account. We try to keep this repository to be very simple and get you idea on how to integrate your current application with samlify, even though you only have basic knowledge on SAML-based implementation.

We will continue to add more common identity providers in this example repository.

Development

yarn
yarn dev

Credential for Okta Login

Username: [email protected]
Password: AUvRhaudDxHHb3vuPydP

If you want to have your own login for testing, please send an email to [email protected].

Features Completed

  • SP-init SSO, Okta IDP with (redirect/post) binding (Encrypted/Signed/Encrypted + Sign)
  • SP-init SLO, Okta IDP with (redirect/post) binding

Remarks: If SP-initiate SSO works, IDP initiate SSO works as well.

Tutorial

Coming soon ...

react-samlify's People

Contributors

tngan 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar

react-samlify's Issues

Some doubts!

Hi @tngan

I would like to thank you for all the effort you put on making samlify, it has a great api!

I'm working on a solution to integrate a SSO service in a react single page application.

This SPA is going to consume a Drupal 8 REST API. Drupal 8 has its own authentication system, it can be any of these: OAuth2, JWT, Cookie or Basic Auth.

The React app is going to initiate the login for the user with the idP (Azure AD), and once it receives the SAML response, needs to connect to the Drupal API using any of the previously mentioned auth methods.

My question is, If the SAML response provides a username (email) but not a password, then how can I authenticate with the Drupal API?

A user must be registered with Drupal to successfully obtain an access token to consume the rest api. So, imagine a user that is not registered with Drupal but it is registered with the idP, then the user is going to successfully login with the idP and redirected back to the react App, but won't be able to authenticate with Drupal because it is not registered, this is where my issue is related.

Here is a small diagram of what I need to achieve:

image

Am I getting it right? o there is something I'm missing?

yarn leeds into error on Windows 10

yarn retuns with error as shown below:

Error: Cannot find module 'libxmljs-mt'\r
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)\r
at Function.resolve (internal/modules/cjs/helpers.js:30:19)\r
at [eval]:1:33\r
at Script.runInThisContext (vm.js:119:20)\r
at Object.runInThisContext (vm.js:326:38)\r
at Object. ([eval]-wrapper:6:22)\r
at Module._compile (internal/modules/cjs/loader.js:701:30)\r
at evalScript (internal/bootstrap/node.js:589:27)\r
at startup (internal/bootstrap/node.js:265:9)\r
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)\r
gyp: Call to 'node -p -e "require('path').dirname(require.resolve('libxmljs-mt'))"' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:345:16)
gyp ERR! stack at ChildProcess.emit (events.js:189:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Windows_NT 10.0.17763

error C:...\react-samlify-master\react-samlify-master\node_modules\samlify: Command failed.
Exit code: 1
Command: make validator
Arguments:
Directory: C:...\react-samlify-master\react-samlify-master\node_modules\samlify

Can you please clarify how to configure users on okta.com?

I registered on okta.com and configured it as IdP, but I cannot receive email &login fields from OKTA.

Can you please make a screenshots how you configured user attributes (or mapping between OKTA & passify) for passify?

Thank you in advance!

How to setup SP service

Hi,
Is there any way to set up an SP service? any guide to complete setup? The goal is to set up a SP service to test my IdS product.

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.