New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to retrieve user from token and able to do curl calls only when admin is logged in #65
Comments
It doesn't show this error when I've logged in as admin. But as soon as I log out, It starts to throw this error for all urls or curl calls |
I think you are missing the |
I did that earlier and now again. but still same issue. If I log-in as admin and then go to localhost:8000, It works. But if I logout and then hit localhost:8000, it throws same error as attached above. |
I'm using django version 1.8.3 with python 3.4. Attaching my settings.py as well. |
You have |
That worked, but I wasn't using session authentication in my views.py. So, I don't know how that was working with admin being logged in. |
It was used in your settings.py About your 401 responses, I'm not sure. I don't have all the elements to help you. |
What files/code snippets do you need for this? I'll be really grateful to you if you can help me out on this. I've already shared my settings.py and views.py |
Could you show me the whole process ? By the way, I've noticed that you are restricting your api with the isadmin permission in your settings.py |
Token conversion is working fine. Current Issue after commenting out isAdminPermission: What I'm missing? ᐧ On Tue, Aug 2, 2016 at 10:26 PM, Philip Garnero notifications@github.com
Regards, |
Open the file lib/python3.4/site-packages/oauth2_provider/ext/rest_framework/authentication.py in your virtualenv and print something on the first line of the authenticate function. If it is printed, I have no clue and we'll have to investigate by printing the request headers to begin with. |
|
Yes, simply add the |
It's fixed. You've been of a great help Philip. Integration would have been easy if I had slightly more experience in DRF. Will recommend this library to everyone. |
Hi Philip,
I'm little new to DRF and Oauth2. So, this might be a silly question again.
I need your help to understand this.
I've successfully authenticated user from facebook. But I'm not able to validate the same in application.
Whenever I hit http://localhost:8000/users/user/1/
I get HTTP 401 Unauthorized
Attached views.py for user model. I'm not able to
views.txt
get user from token supplied. So
Can you help me how to get user from token? Thanks in advance!
The text was updated successfully, but these errors were encountered: