An open API service indexing awesome lists of open source software.

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.

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=

```