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
0
votes
1 answer

Request object has no attribute 'oauth2_error' in DRF + DOT

I'm using djangorestframework and django-oauth-toolkit for my API. I have a fairly simple user logout view, which supports both DOT logout with token revoking and regular Django session logout: class UserLogoutView(APIView): permission_classes…
pomo_mondreganto
  • 2,028
  • 2
  • 28
  • 56
0
votes
1 answer

Customize Django rest framework authentication response {"detail": "Authentication credentials were not provided."}

I am using django 2.1 and python 3.6 and django rest framework 3.8.2 ... I am trying to find a way to customize the json response when authentication failed. I am using a third party package Django OAuth Toolkit The only way I could think of is…
0
votes
0 answers

How to implement code grant flow in REST API?

I am developing web application in React and Django(Rest Framework)., i want to users can login with google account., I approach i followed is implicit grant flow.,where i get the access token in the front end., and sent the access token to the…
Hari
  • 1,545
  • 1
  • 22
  • 45
0
votes
2 answers

django-oauth-toolkit logout issue with not prompting the user for username/password every time

I cannot find any information about this issue anywhere online, so I'm going to put it here! I'm using a frontend application which redirects to a custom auth_views.LoginView on the backend (django-oauth-toolkit) with the client_id, etc. I have all…
0
votes
1 answer

Django rest framework social oauth2 api url and response customization

I am making an API system which follows url like localhost:8080/api/v1/end_name and i'm using django-rest-framework-social-oauth2 library for social authentication also for my custom user authentication. The problem is they are providing api…
0
votes
1 answer

raise exception in django oauth toolkit

I'm using Django 2.x and django-oauth-toolkit to generate access token. I have written a custom token view to run a few checks on the account and then generate access token to the user. If custom check fails, I want to raise an exception with 400…
Anuj TBE
  • 9,198
  • 27
  • 136
  • 285
0
votes
1 answer

extending abstract model in Django

I'm using Django 2.x and OAuth Toolkit. I'm writing an application where I need to add ForeignKey pointing to Application model of OAuth Toolkit plugin, which is defined Abstract. According to the documentation. I can extend the AbstractApplication…
Anuj TBE
  • 9,198
  • 27
  • 136
  • 285
0
votes
0 answers

Writing my own custom back-end in Django

I am trying to build an application which consumes a third party API. I want to implement OAuth2 in my application using that API. Now, I am able to receive the authorization token, followed by an access token and refresh token. But, I am lost…
Alfarhan Zahedi
  • 141
  • 2
  • 13
0
votes
1 answer

Is it possible to get twitter access_token without Backend?

I am trying to build an app which has Django DRF Backend and React Frontend. I used 'oauth2_provider' and 'rest_framework_social_oauth2' on Backend. I succeeded to get the facebook access_token by only using React Frontend. Send it to Backend and…
Zhong Ri
  • 2,556
  • 1
  • 19
  • 23
0
votes
1 answer

How can I implement html views for django-oauth-toolkit?

I am following the basic tutorial in Django OAuth Toolkit . Do I have to create the html files for the views (eg login.html, loggout.html)? My thought is that there is a default "out of the box implementation" for these files. I get the following…
Koji D'infinte
  • 1,309
  • 12
  • 20
0
votes
1 answer

Where to put Django OAuth Toolkit middleware in Django 2?

I'm trying to follow a tutorial on the Django OAuth Toolkit: https://django-oauth-toolkit.readthedocs.io/en/latest/tutorial/tutorial_03.html. The instructions say to update de MIDDLEWARE as follows: MIDDLEWARE = ( '...', # If you use…
Kurt Peek
  • 52,165
  • 91
  • 301
  • 526
0
votes
1 answer

I am using django-oauth2-provider to generate token. But i want to keep one session at a time

I am using django-oauth2-provider to generate token. But i want to keep one session at a time. Like if a user login at one device and request another login from other device then the initial token should be expired. Can I handle this thing with…
Zaman Afzal
  • 2,009
  • 17
  • 23
0
votes
1 answer

django oauth request with bearer token returns "relative imports require the 'package' argument" error

I am trying to implement the django oauth toolkit by following this tutorial: https://django-oauth-toolkit.readthedocs.io/en/latest/tutorial/tutorial_03.html But I can't get past this step as the curl get request at the bottom of the page returns…
jbprog
  • 61
  • 1
  • 3
0
votes
2 answers

Django OAuth Toolkit and POSTMAN

I made a django OAuth server using Django OAuth Toolkit. I've setup the code right and when I use CURL in the following way: curl -X POST -d "grant_type=password&username=geethpw&password=abcabcabc"…
JGCW
  • 1,509
  • 1
  • 13
  • 25
0
votes
1 answer

Get logged in users details and group permissions in rest api

In my python rest api application, I have successfully included the django oauth2 toolkit and I am getting accesstoken while logging in. Now I have to write an api to get the details of the current logged in user and his group information and the…
Arun SS
  • 1,791
  • 8
  • 29
  • 48