redux-oidc-ssr
TypeScript icon, indicating that this package has built-in type declarations

3.0.0-beta.17 • Public • Published

redux-oidc

Build Status

A package for managing OpenID-Connect authentication in ReactJS / Redux apps. It wraps the popular oidc-client library to redux actions and reducers.

Installation

npm install --save redux-oidc

Peer dependencies (Version 3)

This package wraps oidc-client-js to use with ReactJS / Redux apps. When using classic React, install this:

npm install --save oidc-client

If you are using SSR, install this instead:

npm install --save oidc-client-fetch

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

babel-polyfill

You need the babel-polyfill in your build configuration for this package to work.

Note for react-native users

This library doesn't fully support react-native apps. Please use this library instead.

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

Version 3 under development

I've decided to overhaul the API of this library. The main changes include:

  • better SSR support due to not relying on window anymore,
  • removed childContext from the <OidcProvider />, user manager now must be passed in as a prop,
  • immutablejs is now an optional dependency and doesn't need to be installed for those not using it,
  • dropped support for shouldValidate - the middleware now always validates the user,
  • dropped support for triggerAuthFlow - this must now be initiated by a custom action (see example app),
  • cleaner API all around

The example app is already updated to reflect these changes.

Version 2

Check out the wiki for further information for Version 2.

Sample app

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

Tests

npm run test

Package Sidebar

Install

npm i redux-oidc-ssr

Weekly Downloads

2

Version

3.0.0-beta.17

License

MIT

Unpacked Size

35.3 kB

Total Files

17

Last publish

Collaborators

  • colindekker