Questions tagged [oauth2-toolkit]
11 questions
16
votes
4 answers
In the Django REST framework, how are the default permission classes combined with per-view(set) ones?
I'm reading http://www.django-rest-framework.org/api-guide/permissions/ and trying to relate it to the OAuth2 toolkit documentation, http://django-oauth-toolkit.readthedocs.io/en/latest/rest-framework/getting_started.html. The latter has an example…

Kurt Peek
- 52,165
- 91
- 301
- 526
5
votes
1 answer
Django OAuth Toolkit and Django Rest Swagger Integration
I'm using OAuthToolkit and DjangoRestSwagger. I've created an application using Django Admin, and now I've client_id and client_secret.
I want to generate the token using client_id and client_secret. Currently, I use curl to generate the token.
curl…

Praful Bagai
- 16,684
- 50
- 136
- 267
3
votes
0 answers
How to use the OAuth2 toolkit with the Django REST framework with class-based views?
I'm trying to add an API using the Django REST framework to an existing codebase which uses the Django OAuth2 toolkit. The existing views make use of the fact that the OAuth2 toolkit's backend modifies the behavior of Django's login_required…

Kurt Peek
- 52,165
- 91
- 301
- 526
2
votes
3 answers
Django OAuthToolkit Scopes per specific method
I'm using Django Rest Framework and OAuthTookit.
I want that the scope provided by the token should be HTTP Method specific. For eg:- GET, PUT, DELETE of the same APIView should have different scopes.
Following are my APIs.
class…

Praful Bagai
- 16,684
- 50
- 136
- 267
2
votes
1 answer
How to access OAuth2 client_id in django rest framework?
I have my django rest framework API protected by Oauth2 toolkit, but I don't know how to get the client_id of the current authorized requests.
class RequestTransactionView(APIView):
def post(self, request, format=None):
transaction =…

James Lin
- 25,028
- 36
- 133
- 233
0
votes
1 answer
Django: reencode request and call another view
I am working on a backend application that exposes a JSON-based REST api. However, I am using some library that has some of its own endpoints and they accept form-endcoded data. I want to extend the actions done by those endpoints and expose my…

Ibolit
- 9,218
- 7
- 52
- 96
0
votes
1 answer
In Django tests, why do I need to use .objects.get() instead of what was returned by .objects.create()?
Although this is perhaps not a minimal example, I'm building on How to test an API endpoint with Django-rest-framework using Django-oauth-toolkit for authentication. I have a model Session which I'd like to be able to update using the Django REST…

Kurt Peek
- 52,165
- 91
- 301
- 526
0
votes
1 answer
Django OAuth Toolkit protected_resource for class-based views
I want to use @protected_resource() decorator with class-based views.
But I get error: 'update_card' object has no attribute 'get_full_path'
In documentation Class-based views page is empty…

Zulfugar Ismayilzadeh
- 2,643
- 3
- 16
- 26
0
votes
1 answer
Get django OAuth2 Toolkit access token from android client
Please, can you help me how can i Get django OAuth2 Toolkit access token from android client like we do it with curl ? I tried many ways in vain for several days. For other information I use retrofit as android http library.

angel
- 104
- 12
0
votes
2 answers
django rest framework OAuth2 Toolkit
i use django rest framework and OAuth2 Toolkit in my django backend app. I registered users in django admin site. Whne i try to get access token with CURL for user i get error:
{"error":"invalid client"}.
my curl request is bellow:
curl -X POST…

angel
- 104
- 12
0
votes
0 answers
Restrict spyne SOAP service with oauth2_provider
I need to restrict some of my SOAP method so they can only be accessible with an Access Token.
My SOAP service is running with Spyne and my OAuth2 provider comes from django-oauth2-toolkit.
from django.contrib.auth.decorators import…

Quentin Hayot
- 7,786
- 6
- 45
- 62