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

89 questions
3
votes
1 answer

Django OAuth Toolkit: could not import ext.rest_framework

I am trying to set up OAuth2 authentication system for my Django REST API (using DjangoRestFramework and Django-Oauth-Toolkit). I wrote everything according to the official documentation, but the system gives error "could not import…
funtik
  • 1,050
  • 1
  • 8
  • 18
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,315
  • 3
  • 25
  • 54
3
votes
2 answers

django-oauth2-provider with custom user model?

I am really stuck in my project right now. I am trying to implement Oauth2 for my app. I found out about django-oauth2-provider a lot and tried it. The only problem is, it uses the User model at django.contrib.auth. The main users of our site are…
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
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
  • 13,244
  • 9
  • 62
  • 114
2
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", …
2
votes
0 answers

DjangOAuthToolkit - How to have different read/write scope for a View?

I'm using DRF and OAuthToolkit. Here is my view:- class UserDetailView(RetrieveUpdateDestroyAPIView): serializer_class = UserUpdateSerializer permission_classes = [TokenHasResourceScope] required_scopes = ['user_detail'] Now, the above…
PythonEnthusiast
  • 14,299
  • 33
  • 103
  • 218
2
votes
1 answer

'type' object is not iterable with Django Rest Framework and django oauth2-toolkit

Well I am trying to create new access token for the login user on creation with custom authentication class in views. Serializer.py class UserCreateSerializer(ModelSerializer): def create(self, validated_data): user =…
sri ganesh
  • 71
  • 8
2
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
  • 21
  • 1
2
votes
1 answer

Integrate Django Oauth Toolkit urls correctly

I followed the instructions from the official django-oauth toolkit doc (https://django-oauth-toolkit.readthedocs.io/en/latest/tutorial/tutorial_02.html) and included all oauth-toolkit urls manually to prevent users from creating applications. In my…
2
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="…
2
votes
1 answer

Client Authentication in Django rest framework powered App using django-oauth-toolkit

I am creating a project in django for my mobile app. The django project is the API backend for the mobile App. I have created a signup for the user model using django rest framework. The signup API works fine. Now, i want to let only the request…
2
votes
1 answer

Django oauth toolkit: migrate gives type error - getting started tutorial

I am trying to follow the getting started tutorial for django oauth toolkit from: https://django-oauth-toolkit.readthedocs.io/en/latest/rest-framework/getting_started.html When I run migrate, I get this error: File…
leferaycloud
  • 63
  • 1
  • 4
2
votes
1 answer

Django rest api Change oauth response error format

I have successfully implemented oauth2 for my django rest api project. I want to change the error response format of the login api. Current error response is { "error_description": "Invalid credentials given.", "error": "invalid_grant" } I…
2
votes
0 answers

How to get Rails to use an OAuth2 provider based on django-oauth-toolkit

I'm trying to get a Rails app to use an external OAuth2 provider that I set up using django-oauth-toolkit. I'm using the omniauth-oauth2 strategy as a base and set up my own local URLs for the authentication and token URLs.…