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

Question: Combining OIDC provider with REST Framework #242

Closed
ggjersund opened this issue May 23, 2018 · 7 comments
Closed

Question: Combining OIDC provider with REST Framework #242

ggjersund opened this issue May 23, 2018 · 7 comments

Comments

@ggjersund
Copy link

ggjersund commented May 23, 2018

Is there a way to combine this provider with Django REST framework? Or does OIDC Provider come with an authentication backend middleware?

I want to be able to simply accept the access token on my API and extract the user information (same database) from it. I've tried reading through the code, and the docs, however, I couldn't seem to find any information about this.

TLDR; I have a resource server and this provider running in the same Django Project. Can I check the access tokens sent to the API as a middleware?

@juanifioren
Copy link
Owner

DUPLICATE. SEE #78

Hi @ggjersund. This is a feature we want to add. Here it's some code created by @koriaf about an integration with DRF.

https://gist.github.com/koriaf/907d1e16068d1a04056eedf736a203f5

@ggjersund
Copy link
Author

@juanifioren Does this work for all the token types? or just bearer?

@juanifioren
Copy link
Owner

It also supports URI Query Parameter

@wojtek-fliposports
Copy link
Contributor

I'm using own Auth class to validate OpenID Connect JWT tokens in DRF. I will try to PR with authentication DRF class. One question to @juanifioren does scopes are included inside token in the latest version of this lib?
If not, I will also provide ID_TOKEN processing hook to inject scopes inside token

@suutari-ai
Copy link
Contributor

@wojtek-fliposports Do you mean like in PR #194?

@juanifioren
Copy link
Owner

@wojtek-fliposports Now is on develop (added by @suutari-ai).

@JackAtOmenApps
Copy link

@ggjersund - Does #342 help?

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

No branches or pull requests

5 participants