Skip to content

React component to provide OpenID Connect and OAuth2 protocol support. 🌳

License

Notifications You must be signed in to change notification settings

bjerkio/oidc-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6f54a68 Β· May 5, 2025
Dec 9, 2024
Apr 9, 2020
Oct 22, 2024
Nov 11, 2023
Dec 9, 2024
Sep 26, 2021
Apr 9, 2020
Apr 9, 2020
Nov 11, 2023
Nov 11, 2023
Nov 11, 2023
Jun 20, 2023
Nov 11, 2023
Apr 9, 2020
Oct 22, 2024
Dec 9, 2024
May 5, 2025
May 2, 2023
Mar 1, 2023
Oct 22, 2024

Repository files navigation

OIDC React

code style: prettier code style: airbnb Commitizen friendly semantic-release codecov

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 🌳