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
18
votes
2 answers

Could not import 'oauth2_provider.ext.rest_framework.OAuth2Authentication' for API setting 'DEFAULT_AUTHENTICATION_CLASSES'

It's the first time I work with django rest and Django Oauth toolkit I'm following this tutorial oauth2-with-django-rest-framework But when I run python manage.py migrate I get the following error: ImportError: Could not import…
14
votes
3 answers

Generating single access token with Django OAuth2 Toolkit

I'm using the latest Django OAuth2 Toolkit (0.10.0) with Python 2.7, Django 1.8 and Django REST framework 3.3 While using the grant_type=password, I noticed some weird behavior that any time the user asks for a new access token: curl -X POST -d…
Gal Silberman
  • 3,315
  • 3
  • 25
  • 54
10
votes
4 answers

Django OAuth Toolkit - Register a user

I've gone through the docs of Provider and Resource of Django OAuth Toolkit, but all I'm able to find is how to 'authenticate' a user, not how to register a user. I'm able to set up everything on my machine, but not sure how to register a user using…
10
votes
1 answer

Django OAuth- Separate Resource and Authorization Server

I'm using Django Oauth Library. I want to have different Auth and Resource Server. On Auth Server, following is my setting. INSTALLED_APPS = [ ... 'oauth2_provider', 'rest_framework', ] REST_FRAMEWORK = { …
PythonEnthusiast
  • 14,299
  • 33
  • 103
  • 218
7
votes
3 answers

Securing Django OAuth Toolkit Views

We're looking to implement Django OAuth on our backend in order to integrate Alexa and other 3rd party APIs. We've been following the tutorials on their site (http://django-oauth-toolkit.readthedocs.io/en/latest/tutorial/tutorial.html), but have run…
Nat Homer
  • 400
  • 3
  • 15
5
votes
2 answers

Django-OAuth-ToolKit : Generating access token's for multiple resources/services using client credentials grant type of OAuth2.0

I have a couple of backend API's which are Django projects. They have a UI ( single page app) to it and a user name password based login. My clients are usually developers and they don't want the UI , all they want is the access to the backend API's…
4
votes
1 answer

Getting Permissions issue on sending the authenticated request to OAuth2.0 Django rest Framwork

I Have integrated the OAuth2.0 with django-rest-framework. When I send the authenticated request to my class based view I got this { "detail": "You do not have permission to perform this action." } settings.py REST_FRAMEWORK = { …
4
votes
0 answers

Introspection endpoint with django oauth toolkit

Django OAuth toolkit recently added ability to separate the provider and resource servers using Introspection endpoint. However, the documentation is not clear on how to properly achieve this. Anyone who has successfully done this?
nyabwana
  • 41
  • 3
4
votes
1 answer

How can I get the current logged in user from a django-oauth-toolkit token?

I'm using Django and django-oauth-toolkit to build a generic OAuth2 Authorization Server for Auth0. I plan to use the Django server to authenticate users to several different services, using Auth0 as an intermediary. I have a view that is called…
Jon Buys
  • 457
  • 4
  • 13
3
votes
0 answers

How to implement google and facebook oauth2 in django rest framework?

I am a nodejs developer but currently migrating to django(being a python lover). I am trying to implement OAuth2 in Django Rest Framework but I don't know how to start. In nodejs, there is passportjs library which is well maintained, and it's got…
ahmed osama
  • 120
  • 1
  • 12
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
  • 17,297
  • 13
  • 46
  • 85
3
votes
2 answers

django-oauth-toolkit : Customize authenticate response

I am new to Django OAuth Toolkit. I want to customize the authenticate response. My authenticate url configuration on django application is : url('authenticate/', include('oauth2_provider.urls',…
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 - 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…
PythonEnthusiast
  • 14,299
  • 33
  • 103
  • 218
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 = { …
1
2 3 4 5 6