After following auth0’s quick start, I can’t seem to find a way to access the logged-in user’s “user_metadata” in django. Anyone else tried to achieve this with django and can share how?
I followed the following quick start:
After following auth0’s quick start, I can’t seem to find a way to access the logged-in user’s “user_metadata” in django. Anyone else tried to achieve this with django and can share how?
I followed the following quick start:
Hey there!
Hmm it’s indeed not documented there. Let me do a bit of research and get back to you once I find something
Have you tried accessing request.user object properties and looking there?
Yes, I’m not seeing anything relevant there. I also tried to add a Rule in order to inject the value from the user_metadata into the accessToken with a custom namespace, and then to request it as one of the scopes/claims. Can’t see it made any difference, the data is also not in the UserSocialAuth.extra_data field.
I finally managed to do it. Follow these steps:
Then it worked for me, and the variable made its way into user.social_auth.get(provider=‘auth0’).extra_data.
Hope that would help other people.
Wohoo! Glad to hear that and thanks for sharing with the rest of community!