Skip to content

A package for managing OpenID Connect authentication in ReactJS / Redux apps

License

Notifications You must be signed in to change notification settings

jbellmore31g/redux-oidc

 
 

Repository files navigation

redux-oidc

Build Status

A package for managing OpenID-Connect authentication in ReactJS / Redux apps.

Installation

npm install --save redux-oidc

Peer dependency

This package has oidc-client-js as its peer dependency. In order to install this run:

npm install --save oidc-client

In addition there is a peer dependency for immutable.js, if you want to use it.

Description

This package handles OpenID-Connect authentication in redux apps. It enables redux apps to authenticate with an external OIDC authentication provider and handles the actions of the OpenID implicit flow.

It uses the oidc-client-js library to manage OpenID Connect functionality.

It contains the following parts:

  • oidcMiddleware: redux middleware to automatically check whether or not the current user is signed in & trigger the authentication flow,
  • CallbackComponent: A react component processing the callback from the OpenID-Connect provider,
  • reducers & actions: reducers and actions to handle OIDC events,
  • helpers: create helpers to manage the oidc-client-js library

Reasons developing version 2

  • the old version was relying on the oidc-token-manager which was not npm compliant and had to be manually maintained, this version now uses the oidc-client-js library which is written in ES6, fully tested and npm compatible,
  • the old version also relied heavily on creating new instances of the token manager, which could cause unexpected behavior when more than one instance was active at the same time - this version only needs a single instance of UserManager to work,
  • the old version had little which pronounced the redux in oidc-redux. This version offers a reducer including dispatchable actions to handle OIDC interactions.

Version 1

This is the page for version 2 of this package. For version 1 check out the v1 branch.

Documentation

Check out the wiki for further information.

Sample app

There is a sample application demonstrating the use of this package here.

Tests

npm run test

About

A package for managing OpenID Connect authentication in ReactJS / Redux apps

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%