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

OIDC_EXTRA_SCOPE_CLAIMS in OIDC_AUTH #45

Open
popadi opened this issue Dec 15, 2020 · 3 comments
Open

OIDC_EXTRA_SCOPE_CLAIMS in OIDC_AUTH #45

popadi opened this issue Dec 15, 2020 · 3 comments
Labels

Comments

@popadi
Copy link

popadi commented Dec 15, 2020

Hello!

Any way of using OIDC_EXTRA_SCOPE_CLAIMS in OIDC_AUTH or this is something that's available only in django-oidc-provider? I'm trying to add extra claims to the token (i.e. user's department) but I'm not sure if it's possible do it only by using this package.

Thank you.

@kerrermanisNL
Copy link
Contributor

@popadi
Copy link
Author

popadi commented Dec 23, 2020

Hi popadi, do you mean OIDC_CLAIMS_OPTIONS?

Hey!
No, I know you can set that, I was referring to a property like OIDC_EXTRA_SCOPE_CLAIMS that would allow you to add extra claims to the token, others than the classic 6 aud, iss, sub, jti etc. Initially I saw that property in the django-oidc-provider package. I accidentally used the wrong link above, the correct link is actually this and this. Basically I was wondering if this package allows me too do something similar.

@kerrermanisNL
Copy link
Contributor

Just so we're on the same page here do you want to read those claims for the token, or do you want to add them? Adding them is not possible in any way, since this is not an OIDC provider :)

If you want to read them, I'm not entirely sure since I haven't used it in this package. But you can probably just add them in the OIDC provider, then this package will read them from the OIDC_CLAIMS_OPTIONS (https://github.com/ByteInternet/drf-oidc-auth/blob/master/oidc_auth/settings.py#L14), i.e.:

def claims_options(self):
and
claims_options=self.claims_options
. Again, have not used this functionality myself, but I imagine it would work like so :) Probably easiest to try it out and see :)

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

No branches or pull requests

2 participants