Skip to content
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

Django REST framework oauth2 #44

Closed
pmcao opened this issue Aug 24, 2014 · 6 comments
Closed

Django REST framework oauth2 #44

pmcao opened this issue Aug 24, 2014 · 6 comments
Labels

Comments

@pmcao
Copy link

pmcao commented Aug 24, 2014

Hi sahat,

Great work on satellizer so far. Should you consider integrating oauth2 of django REST server?
You will need to modify the parseUser function to extract the returned token.
In django REST server (and other oauth2 providers), the value of the returned token is in 'access_token' key instead of 'token' key as in your server examples.

Example of the django REST framework is available at this page:
http://www.django-rest-framework.org/api-guide/authentication#oauth2authentication

@sahat
Copy link
Owner

sahat commented Aug 24, 2014

There should be a way to change the name of a token. I cannot change it in Satellizer just for Django REST Framework. But more importantly JSON Web Token is not exactly the same thing as access_token. If I call it access_token then it will create a lot of confusion with access_token from Facebook, Google, Twitter and other 3rd party providers.

@sahat sahat added the question label Aug 24, 2014
@sahat
Copy link
Owner

sahat commented Aug 25, 2014

@pmcao I am going to make the token name configurable as discussed in #50 so you could change it to access_token if you wish to.

@pmcao
Copy link
Author

pmcao commented Aug 25, 2014

Thanks. I saw your commits.

Is there anyway to customize the Authorization header for an auth service? Can I use something else instead of "Bearer".
Some servers implementing JWT are accepting "Authorization: JWT " instead of "Authorization: Bearer "

If you could create an example of a client service for JWT, that would be great. I will be able to contribute an example of a server using django REST framework.

httpConfig.headers.Authorization = 'Bearer ' + $window.localStorage[config.tokenName];

@sahat
Copy link
Owner

sahat commented Aug 26, 2014

@pmcao I am going to close this issue. @jpadilla has opened a new issue in for django-rest-framework-jwt to get around this problem: jpadilla/django-rest-framework-jwt#32

@sahat sahat closed this as completed Aug 26, 2014
@jpadilla
Copy link

@sahat thanks, I'll update both issues when it gets done, which should be soon this week.

@jpadilla
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants