Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marmelab/ra-example-oauth
An example of OpenID Connect implementation on React Admin
https://github.com/marmelab/ra-example-oauth
react react-admin
Last synced: about 2 months ago
JSON representation
An example of OpenID Connect implementation on React Admin
- Host: GitHub
- URL: https://github.com/marmelab/ra-example-oauth
- Owner: marmelab
- License: mit
- Created: 2019-09-25T14:23:45.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-06-21T13:17:17.000Z (about 1 year ago)
- Last Synced: 2024-07-03T14:54:59.984Z (3 months ago)
- Topics: react, react-admin
- Language: TypeScript
- Homepage: https://marmelab.com/ra-example-oauth/
- Size: 5.25 MB
- Stars: 53
- Watchers: 6
- Forks: 18
- Open Issues: 28
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ra-example-oauth
This example shows how to support OAuth in a react-admin v4 application.
## Requirements
1. A google application: ret up a project in the [Google API Console](https://console.developers.google.com/) to obtain OAuth 2.0 credentials, set a redirect URI, and (optionally) customize the branding information that your users see on the user-consent screen
2. [Configure OAuth](https://developers.google.com/identity/openid-connect/openid-connect) for this application with `http://localhost:5173/auth-callback` as the authorized origin and `http://localhost:5173/auth-callback` as the authorized redirect URI. Copy the client ID and secret.
3. Rename the `.env.template` files in both the `app` and `api` directory and update the following variables:
- `VITE_OIDC_CLIENT_ID`: Paste the client ID you copied at step 2
- `OIDC_CLIENT_ID`: Paste the client ID you copied at step 2
- `OIDC_CLIENT_SECRET`: Paste the secret you copied at step 2## Installation
Run the following command:
```sh
make install
```## Development
1. Start the API by running:
```sh
make run-api
```2. In another terminal, start the application by running:
```sh
make run-app
```