The locale field in the response returned by /userinfo is documented to be a string, however on at least certain requests I’m getting back an object in the form:
"locale":{"country":"US","language":"en"}
This is causing issues with unmarshaling in the Go SDK which expects a string. As a workaround I can create a custom struct that excludes the locale field as I’m not using it in my app, but I’d like to understand why the response seems to not match what is expected.
FWIW the user I’m specifically encountering this with is using social auth via LinkedIn. I wasn’t able to reproduce it with Facebook, Google, or database auth methods as they seem to omit the locale field entirely from the response.
curl -H 'Authorization: Bearer X' https://xxxx.us.auth0.com/userinfo | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 589 0 589 0 0 2859 0 --:--:-- --:--:-- --:--:-- 2873
{
"sub": "linkedin|XXXX",
"given_name": "X",
"family_name": "X",
"nickname": "X",
"name": "X",
"picture": "https://media.licdn.com/dms/X",
"locale": {
"country": "US",
"language": "en"
},
"updated_at": "2024-08-17T23:08:01.970Z",
"email": "X",
"email_verified": true
}
My LinkedIn social connection is configured with Strategy version 3 and has both the “Profile” and “Email address” attributes enabled.
When I look at the User’s info in the Auth0 “User Management” screen it shows the locale as above in “Identity Provider Attributes”. The field is not editable.