Skip to content

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

License

Notifications You must be signed in to change notification settings

eniantech/oidc-react

 
 

Repository files navigation

Pushing updates to this fork

Ryan - 04/04/2022 - very rough docs.

Clone this repo

git clone git@github.com:eniantech/oidc-react.git

Once you've made changes to the code:

I tried a couple of things so some of the below may be insufficient, but it should help.. First ensure your github token is set, it already will be if you have ever successfully run npm install on puffin. If not, look at puffin docs.

If you've never run npm install in your local version of this repo, you should do so.

npm run build # This line is most likely unneeded
npm start
npm version x.x.x # the next version no. of this package.
npm publish

You should also commit and push your changes to git!

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-js.

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 🌳

About

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

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • TypeScript 100.0%