martin-ngigi / drf-mozilla-django-oidc

OpenID Connect with mozilla-django-oidc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

INSTALLATIONS

pip install django
pip install djangorestframework
pip install djangorestframework-simplejwt
pip install python-dotenv
pip install mozilla-django-oidc
pip install mysql-connector-python
source .venv/bin/activate
cd project
python3 manage.py runserver
  • Run migration
source .venv/bin/activate
cd project
python3 manage.py makemigrations
python3 manage.py migrate

Generating keys

  • generate a private and public key pair using the following command:
openssl genrsa -out private_key.pem 2048
openssl rsa -in private_key.pem -outform PEM -pubout -out public_key.pem

To solve Error 400: redirect_uri_mismatch[ Add url accordingly]

  • Dont forget to add "Authorized JavaScript origins" in Link
http://127.0.0.1:8000
  • Also add "Authorized redirect URI"s in google console
http://127.0.0.1:8000
http://127.0.0.1:8000/oidc/callback/
http://127.0.0.1:8000/accounts/user-infor/

Authentication flow:

About

OpenID Connect with mozilla-django-oidc


Languages

Language:Python 100.0%