OpenID Connect Authentication for React. Supports Hooks 🚀
npm install oidc-react




React component (AuthProvider) to provide OpenID Connect and OAuth2 protocol
support. Has hooks 🎉
Based on oidc-client-ts.
Install packages by running:
``shell`
$ npm install oidc-react
`tsx
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 = () => (
...
);
``
Apart from this README, you can find details and examples of using the SDK in
the following places:
- SDK Documentation
- Guides
- Example repository
- oidc-client-ts Documentation
We love to get help 🙏 Read more about how to get started in
CONTRIBUTING 🌳