1.0.1 • Published 2 years ago

@dslab/ra-auth-oidc v1.0.1

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
2 years ago

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.

1.0.1

2 years ago

1.0.0

2 years ago