@dslab/ra-auth-oidc
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

React-Admin OIDC Authentication

Version Documentation Maintenance License: MIT

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

Show your support

Give a ⭐️ if this project helped you!

License

Copyright © 2023 SmartCommunityLab.
This project is MIT licensed.

Readme

Keywords

none

Package Sidebar

Install

npm i @dslab/ra-auth-oidc

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

66.9 kB

Total Files

56

Last publish

Collaborators

  • dslab