@dslab/ra-auth-oidc
v1.0.1
Published
[![Version](https://img.shields.io/npm/v/@dslab/ra-auth-oidc.svg)](https://www.npmjs.com/package/@dslab/ra-auth-oidc) [![Documentation](https://img.shields.io/badge/documentation-yes-brightgreen.svg)](https://github.com/smartcommunitylab/react-admin-packa
Downloads
9
Readme
React-Admin OIDC Authentication
OpenID Connect authentication provider for React-Admin
Install
yarn install @dslab/ra-auth-oidc
Usage
Import the authentication provider and instantiate by providing the config
import { OidcAuthProvider } from '@dslab/ra-auth-oidc';
const authProvider = OidcAuthProvider({
clientId: 'clientId',
issuer: 'https://ISSUER_URI',
});
const App = () => <Admin authProvider={authProvider} requireAuth></Admin>;
Login components
By default, the react-admin app will include a login page linked to the login()
action exposed by the authentication provider.
This library exports components optimized for the oidc login experience:
- LoginPage
- LoginForm
- LoginButton
Import and use as needed to optimize the login.
import { LoginPage } from '@dslab/ra-auth-oidc';
const myLoginPage = () => <LoginPage />;
const App = () => (
<Admin
loginPage={myLoginPage}
authProvider={authProvider}
requireAuth
></Admin>
);
Author
SmartCommunityLab
- Website: http://www.smartcommunitylab.it/
- Github: @smartcommunitylab
Show your support
Give a ⭐️ if this project helped you!
License
Copyright © 2023 SmartCommunityLab. This project is MIT licensed.