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

Standard claims are ignored when CustomClaim is defined #409

Open
ArcRiiad opened this issue Aug 16, 2023 · 2 comments
Open

Standard claims are ignored when CustomClaim is defined #409

ArcRiiad opened this issue Aug 16, 2023 · 2 comments

Comments

@ArcRiiad
Copy link

ArcRiiad commented Aug 16, 2023

Hi there!

We noticed unexpected behavior after updating django-oidc-provider 0.7 to 0.8 when using standard and custom claims when forging the id_token.

When we define a resolver for custom claims using OIDC_EXTRA_SCOPE_CLAIMS, the OIDC_USERINFO is somehow ignored.

After some research, we discovered that this behavior was introduced by this commit (64e395c) and from what I understood from reading the code, StandardScopeClaims are never called when OIDC_EXTRA_SCOPE_CLAIMS is defined.

So my questions is,

  • Is this normal behavior? (I have some doubts about this after reading the commit message and the corresponding documentation).
Python: 3.10.12
Django: 4.2.1
Django-oidc-provider: 0.8.0

Settings:
OIDC_IDTOKEN_INCLUDE_CLAIMS = True
OIDC_USERINFO = 'users.models.oidc_userinfo'
OIDC_EXTRA_SCOPE_CLAIMS = 'users.models.CustomScopeClaims'
@bmihelac
Copy link

bmihelac commented Jun 24, 2024

I have a similar issue. For now, as a workaround, I am subclassing from StandardScopeClaims:

-class CustomScopeClaims(ScopeClaims):
+class CustomScopeClaims(StandardScopeClaims):

@ArcRiiad did you ever find an answer?

@ArcRiiad
Copy link
Author

Hi @bmihelac! We ended up doing the same thing by forking and patching the package on our end. Unfortunately, I can't share the exact fix since I'm no longer with that company 😅

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

2 participants