Mark Mikofski
2017-02-09 22:00:39 UTC
I would like use django-oauth-toolkit in combination with other auth
backends. Is this possible?
I want to set up a resource and provider on the same web server, to serve
both as a auth service provider and as an API resource.
They have a common user database. As well as a token table using the DRF
token auth backend.
For some applications I want them to authenticate using oauth for their
user. EG: get a token from the provider and then authenticate using the
token for their user.
But some applications don't have any users, and they could just
authenticate directly with the resource using the DRF token auth backend.
And I want to be able to log into the resource directly using my username
and password using the DRF/Django builtin session backend.
When I try this, it works to use my username and password in the admin
webpage and the DRF webpage of the resource (which is also the provider).
And it also works if I send a request (using curl or python-requests) from
the command line using oauth2 tokens,
but If I try to send a request using either username/password or the DRF
token, I get either a 401, 403 or a traceback that says the
AssertionError: TokenHasScope requires
the`oauth2_provider.rest_framework.OAuth2Authentication` authentication
class to be used.
If I don't provide any backend at all, what is the default. Is it always
the session backend?
Thanks!
Mark
backends. Is this possible?
I want to set up a resource and provider on the same web server, to serve
both as a auth service provider and as an API resource.
They have a common user database. As well as a token table using the DRF
token auth backend.
For some applications I want them to authenticate using oauth for their
user. EG: get a token from the provider and then authenticate using the
token for their user.
But some applications don't have any users, and they could just
authenticate directly with the resource using the DRF token auth backend.
And I want to be able to log into the resource directly using my username
and password using the DRF/Django builtin session backend.
When I try this, it works to use my username and password in the admin
webpage and the DRF webpage of the resource (which is also the provider).
And it also works if I send a request (using curl or python-requests) from
the command line using oauth2 tokens,
but If I try to send a request using either username/password or the DRF
token, I get either a 401, 403 or a traceback that says the
AssertionError: TokenHasScope requires
the`oauth2_provider.rest_framework.OAuth2Authentication` authentication
class to be used.
If I don't provide any backend at all, what is the default. Is it always
the session backend?
Thanks!
Mark
--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.