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
1
vote
1 answer

403 error with Django-Rest-Framework and Django-Oauth-Toolkit in client_credentials mode

I am trying to us the Django-Oauth-Toolkit authentication with the client_credentials mode, and I can: create successfully create my client_id and client_secret register my token But after, any api call using this token yields a 403 error with the…
Benjamin Breton
  • 1,388
  • 1
  • 13
  • 42
1
vote
1 answer

How to get new access_token from refresh_token using django_oauth_toolkit?

I am using django-oauth-toolkit version 1.1.2 to get access_token as seen below:- Reauest:- POST http://localhost:8597/login { "application_id": "cuOt3raxH9ClbCrbbgP68iU6ssfO2N78TplxwlMq", "username": "test@gmail.com", "password":…
1
vote
0 answers

Use OAuth2 with Spinnaker

So I have two services A and B, and A needs to login to B via Oauth2. B is using is using Django OAuth Toolkit as its Oauth2 provider. Service A is also a Django app (not really important). We are introducing Spinnaker into our stack so that we can…
Brodan
  • 152
  • 1
  • 18
1
vote
0 answers

Django authentication JWT vs Oauth2

I am new to the Django authentication system. I've noticed most companies and developers prefer Oauth2 over JWT based authentication. I just read the Oauth2 documentation, but I don't understand what special features Oauth2 has, and why it is…
1
vote
3 answers

How to implement OAuth when the resource and auth servers are same

I have a Django Rest API with JWT authentication which is the backend for a Angular frontend. There are many clients who use the service with our frontend. Now some enterprise clients wanted to integrate the APIs from their system's backend. I don't…
Aswin Kumar K P
  • 1,023
  • 2
  • 12
  • 21
1
vote
1 answer

django oauth toolkit grant client credentials - accounts/login/

I am trying to use oauth for authentication and authorization in a project. I want to use the client credentials grant type as this project is about a middleware/api that will be consumed by a client application. I have created one corresponding…
Ilir
  • 430
  • 2
  • 7
  • 19
1
vote
0 answers

Use some other User Model instead of settings.AUTH_USER_MODEL in django oauth toolkit

I am using Django oauth toolkit to implement Oauth in my application. I am already having a user model, but i want to use some other user model which is not AUTH_USER_MODEL. What i can see now is that i can only extend all the models and use my…
Ezio
  • 723
  • 6
  • 14
1
vote
0 answers

Is it required to attach request.application in django-oauth-toolkit?

I have a separate resource and auth service and am trying to override the OAuth2Validator in django-oauth-toolkit to work with this setup. In the original impl, OAuth2Validator.validate_bearer_token sets the request.client to the OAuth2 application…
Nathan
  • 1,396
  • 3
  • 18
  • 32
1
vote
1 answer

Django foreign key constraint with Model that lives in different database

I'm trying to use the oauth2_provider library which provides a model for AccessToken, which foreign keys into a User model. My User model will actually live in a different database from the OAuth2 token models. I can use a router to direct which DB…
Nathan
  • 1,396
  • 3
  • 18
  • 32
1
vote
0 answers

Django Oauth2 Toolkit custom mixin

I have a particular situation where we're using Django's OAuth2 toolkit. I need to answer a request with a wrong token with a 401 (with a json) instead of a 403 forbidden. Following this commit I managed to come with…
L Maor
  • 11
  • 1
1
vote
1 answer

exposing only /token/ endpoint to public: Django oauth toolkit

I'm using this plugin which does not require applications creation by any user and any OAuth application can be only added by superuser. I have this included in the urlpatterns path('auth/', include('oauth2_provider.urls',…
Anuj TBE
  • 9,198
  • 27
  • 136
  • 285
1
vote
1 answer

django-oauth-toolkit; Django Rest Framework - Authentication credentials were not provided

My question is related to this one and this one but for some significant differences: for the first reference: I use django-oauth-toolkit although unlike the second reference, the user MUST be authenticated as this is not a registering endpoint but…
Sebastien
  • 1,439
  • 14
  • 27
1
vote
2 answers

generate access token using Postman

I have written API using Django REST Frameword and Django oAuth Toolkit for oauth2 authentication and using Postman to test my API authorization process. I have to send following curl request curl -X POST -d…
Anuj TBE
  • 9,198
  • 27
  • 136
  • 285
1
vote
1 answer

Is OAuth2 TokenScope similar to Django Permissions?

I'm building a dedicated OAuth2 as a service for my application, where users will be both authenticating and authorizing themselves. I've the following concerns 1) Is OAuth2 TokenScope similar to Django Permissions? 2) If I want to make role-level…
Praful Bagai
  • 16,684
  • 50
  • 136
  • 267
1
vote
2 answers

Saving Facebook picture in Django Model (REST Social Oath2)

This question is about saving Facebook Profile pictures in the Django model automatically, using https://github.com/PhilipGarnero/django-rest-framework-social-oauth2 library. Edit: There are 2 ways to solve this question: Save the URL of the image…
GRS
  • 2,807
  • 4
  • 34
  • 72