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

3.2.2Β β€’Β PublicΒ β€’Β Published

OIDC React

code style: prettier code style: airbnb Commitizen friendly semantic-release Build & Deploy

Language grade: JavaScript codecov Maintainability

oidc-react logo

About

React component (AuthProvider) to provide OpenID Connect and OAuth2 protocol support. Has hooks πŸŽ‰

Based on oidc-client-ts.

Quickstart

Install packages by running:

$ npm install oidc-react

Usage

import { AuthProvider } from 'oidc-react';

const oidcConfig = {
  onSignIn: () => {
    // Redirect?
  },
  authority: 'https://oidc.io/oauth',
  clientId: 'this-is-a-client-id',
  redirectUri: 'https://my-app.com/',
};

const Routes = () => (
  <AuthProvider {...oidcConfig}>
    <Switch>
      <Route exact path="/">
        <Dashboard />
      </Route>
      ...
    </Switch>
  </AuthProvider>
);

Documentation

Apart from this README, you can find details and examples of using the SDK in the following places:

Contribute & Disclaimer

We love to get help πŸ™ Read more about how to get started in CONTRIBUTING 🌳

Readme

Keywords

none

Package Sidebar

Install

npm i oidc-react

Weekly Downloads

15,572

Version

3.2.2

License

MIT

Unpacked Size

64.6 kB

Total Files

22

Last publish

Collaborators

  • simenandre
  • jsrugland
  • moripen
  • xillians
  • brustad
  • braaar
  • bjerk-bot