Questions tagged [django-oauth]

Django OAuth Toolkit can help you providing out of the box all the endpoints, data and logic needed to add OAuth2 capabilities to your Django projects

Django OAuth Toolkit can help you providing out of the box all the endpoints, data and logic needed to add OAuth2 capabilities to your Django projects. Django OAuth Toolkit makes extensive use of the excellent OAuthLib, so that everything is rfc-compliant.

Requirements:

  • Python 2.7, 3.4, 3.5, 3.6

  • Django 1.8, 1.9, 1.10, 1.11

Site: https://django-oauth-toolkit.readthedocs.io/en/latest/

Support: https://groups.google.com/forum/#!forum/django-oauth-toolkit

93 questions
3
votes
0 answers

django-oauth-toolkit - provide application access to specific model

I have a concept of Slack's workspaces in my app and I'd like my consumers to specify to which "workspace" they are installing an app. Even though I can see that I can extend an Application model, it doesn't really help. Is there some best practise…
Jan Vorcak
  • 19,261
  • 14
  • 54
  • 90
3
votes
2 answers

DRF request.data has no attribute _mutable

I'm using Django 2.x and Django REST framework. I'm using django-oauth-toolkit to enable OAuth2 authentication and django-rest-auth for login and django-allauth for user registration. I want to generate access token in the response when a user is…
Anuj TBE
  • 9,198
  • 27
  • 136
  • 285
3
votes
0 answers

Unsupported grant type with Django Oauth Toolkit

I'm using the Django Rest Framework with django-oauth-toolkit, When I make a request on POSTMAN, with this body it works fine, { "username":"username", "password":"password", "client_id":"something", "client_secret":"somethingelse", …
3
votes
1 answer

Maintaining a session using Django REST API

Is there any way to maintain state (session) of the user instead of storing tokens in local storage on the client side which makes them vulnerable to theft. And how exactly can we do that in Django Rest Framework? Right now I have OAuth implemented…
3
votes
0 answers

Django Oauth Issue 'AccessToken' object is not callable or not iteratable

I am try to implement the Django Oauth for generating Access token with respect to user creation with class based method. serializer.py class UserCreateSerializer(ModelSerializer): def create(self, validated_data): user =…
ganesh
  • 31
  • 1
3
votes
0 answers

Django - Support Multiple Login Mechanism

I've a Django Application which needs to support multiple login mechanisms ie, the default Django Authentication, Phone Number(or some other Unique Identifier) OTP Authentication and should also support token mechanism. I know all about how I can…
Praful Bagai
  • 16,684
  • 50
  • 136
  • 267
3
votes
2 answers

django-oauth-toolkit 'invalid client' error after deploy on AWS Elasticbeanstalk

I use django-oauth-toolkit with my django/django-rest-framework application. When I request an access token in dev mode on localhost, it works OK: dev@devComp:$ curl -X POST -d "grant_type=password&username= &password="…
3
votes
1 answer

Django-rest-framework with django OAuth 2.0 giving authentication error

I have integrated django-rest-framework with django-oauth-toolkit. And it is giving me {"detail": "Authentication credentials were not provided."} with un authenticated apis. Here's my settings.py REST_FRAMEWORK = { …
3
votes
1 answer

Extra protection layer for Django Rest Framework and OAuth2 Toolkit

This is a follow up question for this. I'm using the latest Django OAuth2 Toolkit (0.10.0) with Python 2.7, Django 1.8 and Django REST framework 3.3 Some background: When authenticating, the client receive a new AccessToken that he uses every time a…
Gal Silberman
  • 3,756
  • 4
  • 31
  • 58
2
votes
2 answers

Django: Add data to JWT payload

I want to add data (such as the token expiration date or user info) to the payload of the JWT generated by this library. The current decoded payload of a JWT generated by this library is the following: { "token":…
2
votes
2 answers

Django ImportError: Module "social_core.backends.google" does not define a "GoogleOpenId" attribute/class

I've cloned my working Django app into a Debian based Linux distribution, I've installed all dependencies, but when trying to login with email and password or with Google account it throws me the following error: ImportError: Module…
2
votes
2 answers

How do I specify DRF oauth required_scopes in function based api_view?

I'm trying to make my function based rest framework views which use the @api_view decorator with the Django OAuth Rest Framework Toolkit, where I'm using TokenHasScope as the permission_class. However, this needs a mandatory attribute called…
2
votes
0 answers

Introspection endpoint is not getting called

I am looking to create an API using the Django REST Framework which will authenticate using a separate authentication server by means of its introspection endpoint. The authorization flow should look something like the following. The client…
Bryan
  • 14,756
  • 10
  • 70
  • 125
2
votes
0 answers

Django OAuth Toolkit how to log the user out

I have set up Django OAuth Toolkit in my project where the authorization server is separate from the application server (i.e accounts.example.com and app.example.com). App server redirects to accounts server using authorize flow; the user inputs…
Gasim
  • 7,615
  • 14
  • 64
  • 131
2
votes
1 answer

How to allow user to modify only his data in Django Rest Framework

i'm building simple API with Django 2.1.8 and provide security with Django OAuth Toolkit. I've reached the point where user can use api only after authorization but i want to limit his acctions only to his data. I've built authorization using oauth2…