Closed pandawankenobi closed 12 months ago
Hi,
I think you just have to subclass OIDCAuthenticationBackend
and override get_userinfo()
to use the data from the id_token to do that.
You can see how to subclass the backend here : https://mozilla-django-oidc.readthedocs.io/en/stable/installation.html#connecting-oidc-user-identities-to-django-users
I am closing this per the last comment. Please re-open if the answer does not address the issue.
In the documentation (https://mozilla-django-oidc.readthedocs.io/en/stable/installation.html#add-settings-to-settings-py) instructions are to add this to settings:
OIDC_OP_USER_ENDPOINT = "<URL of the OIDC OP userinfo endpoint>"
However my OP does not provide such an endpoint in it's well known config. When asked they refer to the instructions here: https://learn.microsoft.com/en-us/azure/active-directory/develop/userinfo#consider-using-an-id-token-instead where instructions are to use a token instead of an endpoint. Is there a way to do this?