Closed sergei-maertens closed 5 years ago
It doesn't force it, it defaults to it.
This is documented in the FAQ: https://django-auth-adfs.readthedocs.io/en/latest/faq.html#i-m-receiving-an-keyerror-upn-error-when-authenticating-against-azure-ad
Let me know if that helps.
How clumsy of me that I missed that, I was looking at the code as well but missed the step where own-config overrides defaults again.
Confirmed that using the email
claim instead works :+1:
Apologies for the notifications noise because of my failure to read more documentation :smiley:
It looks like there's not guarantee the
upn
claim, which is used to look up or create the user, is not always present.I am testing this against a free trial of Azure AD, maybe with a bit of an exotic setup (I have zero AD/Azure knowledge!):
sergei@$employer.com
)User name
field contains the e-mail adress aboveupn
claim.Traceback:
I realize this may have something to do with whitelisted domains, but I'm clueless where I could figure this out in AD itself.
Creating a test-user in Azure AD and logging in with that user works fine and completely as expected, as long as the username contains the proper AD domain.
I'd appreciate pointers if this is a known issue or if I just should not try to log in with that account, or somehow be able to force the
upn
claim for this user.