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

How to get the client_id of the current authorized requests? #123

Closed
variable opened this issue May 12, 2014 · 4 comments
Closed

How to get the client_id of the current authorized requests? #123

variable opened this issue May 12, 2014 · 4 comments
Labels

Comments

@variable
Copy link

I have my django rest framework API protected by Oauth2 toolkit, but I don't know how to get the client_id of the current authorized requests.

@masci
Copy link
Contributor

masci commented May 27, 2014

You should have the access token in request.auth then you can retrieve the client_id in request.auth.application.client_id

@masci masci added the question label May 28, 2014
@itspage
Copy link

itspage commented Jun 24, 2014

Yo, I am not using django rest framework and don't have request.auth in my request object. Is there an alternative way to find the client_id of the current authorized request?

@masci
Copy link
Contributor

masci commented Jun 25, 2014

@itspage no there isn't at the moment, the auth field set by DRF is actually the token instance. We should probably add the access token instance to request so that you can do something similar, like request.token.application.client_id

@masci
Copy link
Contributor

masci commented Jun 25, 2014

See #133

@masci masci closed this as completed Jun 25, 2014
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