davew
February 25, 2022, 9:11pm
1
We have a rule in place that copies social profileData (given_name
, picture
, etc…) from the social identity to the user profile. However, because this is a rule, it’s only executed when the user authenticates.
I would like to copy this profileData in the same way when retrieving a user using the management API, so that I can have an API return user data that would have the same values as returned to the user during authentication.
This profileData is visible in the Auth0 console user page, and the golang SDK User has UserIdentity fields, but profileData is not included (auth0/user.go at 1cc7cea411863817d4c5392f54a87a87edc02dda · go-auth0/auth0 · GitHub ).
Can I get identity profile data using the management API?
If not, what’s the right way to get this profileData for all users in a backend way?
-Dave
1 Like
Hi @davew ,
Welcome to Auth0 Community!
I understand that you want to retrieve user profile data in the Management API. Is this what you are looking for?
1 Like
davew
February 28, 2022, 1:57pm
4
Hi Lihua, I’m specifically looking for the profileData
field within the User identities
field. From the Management API Users endpoint, I get back data like this under the identities
field:
"identities": [
{
"connection": "Initial-Connection",
"user_id": "507f1f77bcf86cd799439020",
"provider": "auth0",
"isSocial": false
},
{
"connection": "google-oauth2",
"user_id": "abc123",
"provider": "google-oauth2",
"isSocial": true
}
],
However, in the Auth0 console User page, I see this data under Identity Provider Attributes > Identities
:
"identities": [
{
"connection": "Initial-Connection",
"user_id": "507f1f77bcf86cd799439020",
"provider": "auth0",
"isSocial": false
},
{
"connection": "google-oauth2",
"user_id": "abc123",
"provider": "google-oauth2",
"isSocial": true,
"profileData": {
"family_name": "some name",
"picture": "https://cdn.googleusercontent.com/user/abc123"
}
}
],
Can I access this profileData
field with the Management API? If so, how?
-Dave
I tested user account linking. The response from the Management API is exactly the same as the details on the Auth0 dashboard.
Here are the steps I did on the Auth0 dashboard.
Install the Auth0 Account Link Extension by following the steps here
Find a user account which has google-oauth2 connection, let’s call it abc@gmail.com .
Getting Started → click on “Try it out”
Click on “Sign Up” and enter abc@gmail.com and the password
The Account Linking window will be popped up.
click on “Continue” to link the two accounts.
get the identifier id and search it in the Management API call
the profiledata is visible and matches the details on the Auth0 dashboard.
Could you please try with the same steps and let us know how it goes? Thanks!
2 Likes
davew
March 7, 2022, 3:24am
6
It looks like the key profileData
is returned by the REST API, but not by the golang SDK.
I’ve opened a PR to add the missing functionality: Add profileData key to UserIdentity by davidwarshaw · Pull Request #33 · auth0/go-auth0 · GitHub
1 Like