This is a demo project to show how to implement OAuth2.0 authentication in a Flutter app using Django REST Framework as the backend. This project uses Resource Owner Password Credentials Grant flow.
django-flutter-oauth2.mp4
sorry for the bad quality / aspect ratio
Set up the Django backend:
pip install -r requirements.txtpython manage.py migratepython manage.py createsuperuserpython manage.py runserverhttp://127.0.0.1:8000/admin/oauth2_provider/application/add/
- Client type: Confidential
- Authorization grant type: Resource owner password-based
Copy the client id and client secret to the flutter/lib/oauth2_login.dart file.
Now you should be ready to go!
This project is heavily based on: