All Projects → bjerkio → oidc-react

bjerkio / oidc-react

Licence: MIT license
React component to provide OpenID Connect and OAuth2 protocol support. 🌳

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to oidc-react

ng-oidc-client
A package for managing OpenID-Connect authentication in Angular apps, wrapping oidc-client-js
Stars: ✭ 48 (-76.92%)
Mutual labels:  oidc-client-js

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 🌳

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].