django-oauth

“error”: “invalid_client” django-oauth-toolkit

对着背影说爱祢 提交于 2020-08-11 04:19:21
问题 I am using django rest framework with django-oauth-toolkit. When i request access token on my localhost it gives me the access token as shown below ~/django_app$ curl -X POST -d "grant_type=password&username=<Your-username>&password=<your-password>" -u"<client-id>:<client-secret>" http://localhost:8000/o/token/ {"access_token": "8u92BMmeZxvto244CE0eNHdLYWhWSa", "expires_in": 36000, "refresh_token": "faW06KKK71ZN74bx32KchMXGn8yjpV", "scope": "read write", "token_type": "Bearer"} But when i

“error”: “invalid_client” django-oauth-toolkit

拈花ヽ惹草 提交于 2020-08-11 04:19:08
问题 I am using django rest framework with django-oauth-toolkit. When i request access token on my localhost it gives me the access token as shown below ~/django_app$ curl -X POST -d "grant_type=password&username=<Your-username>&password=<your-password>" -u"<client-id>:<client-secret>" http://localhost:8000/o/token/ {"access_token": "8u92BMmeZxvto244CE0eNHdLYWhWSa", "expires_in": 36000, "refresh_token": "faW06KKK71ZN74bx32KchMXGn8yjpV", "scope": "read write", "token_type": "Bearer"} But when i

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

风格不统一 提交于 2019-12-14 02:07:57
问题 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 after an application has authenticated, and I need that view to return the details of the currently logged-in user. urls.py: # Return current logged in user (r'^user/current/?$', 'my_app.views.current_user.get_user', {}, 'current_user'), views/current

Where to put Django OAuth Toolkit middleware in Django 2?

ぐ巨炮叔叔 提交于 2019-12-13 02:48:57
问题 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 SessionAuthenticationMiddleware, be sure it appears before OAuth2TokenMiddleware. # SessionAuthenticationMiddleware is NOT required for using django-oauth-toolkit. 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'oauth2_provider.middleware

Django-rest-framework with django OAuth 2.0 giving authentication error

◇◆丶佛笑我妖孽 提交于 2019-12-10 22:17:51
问题 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 = { 'DEFAULT_AUTHENTICATION_CLASSES': ( 'oauth2_provider.contrib.rest_framework.OAuth2Authentication', ), 'DEFAULT_PERMISSION_CLASSES': ( 'rest_framework.permissions.IsAuthenticated', ) } views.py from rest_framework.views import APIView from rest_framework.response import Response

django-oauth-toolkit : Customize authenticate response

☆樱花仙子☆ 提交于 2019-12-09 23:10:38
问题 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', namespace='oauth2_provider')) https://django-oauth-toolkit.readthedocs.io/en/latest/install.html Now, when i launch this command : curl -X POST -d 'grant_type=password&username=$username&password=$password' -u "$client_id:$client_secret" http://127.0.0.1:8000/authenticate/token/ I get this response :

django-oauth-toolkit : Customize authenticate response

怎甘沉沦 提交于 2019-12-04 18:24:22
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', namespace='oauth2_provider')) https://django-oauth-toolkit.readthedocs.io/en/latest/install.html Now, when i launch this command : curl -X POST -d 'grant_type=password&username=$username&password=$password' -u "$client_id:$client_secret" http://127.0.0.1:8000/authenticate/token/ I get this response : { "access_token": "ATiM10L0LNaldJPk12drXCjbhoeDR8", "expires_in": 36000, "refresh_token":

Generating single access token with Django OAuth2 Toolkit

泪湿孤枕 提交于 2019-12-03 12:53:47
问题 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 "grant_type=password&username=<user_name>&password=<password>" -u"<client_id>:<client_secret>" http://localhost:8000/o/token/ A new access token and refresh token is created . The old access and refresh token are still usable until token timeout! My

Generating single access token with Django OAuth2 Toolkit

安稳与你 提交于 2019-12-03 03:19:22
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 "grant_type=password&username=<user_name>&password=<password>" -u"<client_id>:<client_secret>" http://localhost:8000/o/token/ A new access token and refresh token is created . The old access and refresh token are still usable until token timeout! My Issues: What I need is that every time a user asks for a new access token, the old one will become