https://github.com/jackkweyunga/drf_oidc_example
An example django rest framework project with OIDC capabilities. This can be used to create a microservice api in django.
https://github.com/jackkweyunga/drf_oidc_example
Last synced: 3 days ago
JSON representation
An example django rest framework project with OIDC capabilities. This can be used to create a microservice api in django.
- Host: GitHub
- URL: https://github.com/jackkweyunga/drf_oidc_example
- Owner: jackkweyunga
- Created: 2023-07-29T16:08:45.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-29T16:43:44.000Z (almost 3 years ago)
- Last Synced: 2025-03-08T00:28:26.653Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 993 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# DJANGO MICRO SERVICE
An example for a django microservice project.
## Features
- [x] Authentication and Authorization API using [mozilla-django-oidc](https://github.com/mozilla/mozilla-django-oidc) package
- [x] Keycloak Compatible
## Endpoints:
| Endpoints | Description |
|--------------|---------------------------------------------------------------------------------------------------------------------------|
| / | A public api endpoint |
| /protected | A protected endpoint; requires an authenticated user. Requires an Bearer token passed in the request Authorization header |
| /healthcheck | A health check endpoint |
## Setup
create a `.env` file and add the following with there values:
```dotenv
OIDC_RP_CLIENT_ID=
OIDC_RP_CLIENT_SECRET=
OIDC_OP_AUTHORIZATION_ENDPOINT=
OIDC_OP_TOKEN_ENDPOINT=
OIDC_OP_USER_ENDPOINT=
OIDC_OP_END_SESSION_ENDPOINT=
OIDC_OP_JWKS_ENDPOINT=
```