Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add profileData key to UserIdentity #33

Merged
merged 2 commits into from
Apr 6, 2022

Conversation

davidwarshaw
Copy link
Contributor

@davidwarshaw davidwarshaw commented Mar 7, 2022

Description

The key profileData is present in social Identities (see below), but is not in the UserIdentity struct. This means that this SDK cannot be used to retrieve social profile data.
Here's an example of the key within an account with two identities:

...
  "identities": [
    {
      "connection": "Initial-Connection",
      "user_id": "123xyz",
      "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"
      }
    }
  ],
...

This PR adds a profileData field to UserIdentity with type *map[string]interface{} so arbitrary schemas of social providers can be deserialized.

References

This PR was motivated by this thread on the community forum: https://community.auth0.com/t/identity-profiledata-field-not-in-management-api-useridentity/78948

Testing

  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have read and agreed to the terms within the Auth0 Code of Conduct.
  • I have read the Auth0 General Contribution Guidelines.
  • I have reviewed my own code beforehand.
  • I have added documentation for new/changed functionality in this PR.
  • All active GitHub checks for tests, formatting, and security are passing.
  • The correct base branch is being used, if not main.

@davidwarshaw davidwarshaw requested a review from a team as a code owner March 7, 2022 03:22
@davidwarshaw
Copy link
Contributor Author

@sergiughf it would be helpful for us to get this added. Please take a look.

@sergiught
Copy link
Contributor

Hey @davidwarshaw, apologies as this completely skipped my radar. I'll take a look at this today.

@sergiught
Copy link
Contributor

Fixes: #34.

@davidwarshaw The contribution looks good, thanks! I just refactored a little bit the tests in:

Let me know if you have any questions.

Apologies for the time it took to review this! I'll wrap a few more open PRs and / or github issues and I'll make a release with this soon. Stay tuned:)

@sergiught
Copy link
Contributor

Note for other reviewers: This is failing cuz it's coming from a fork and doesn't have access to the secrets for the integration tests.

image

@sergiught sergiught merged commit 6eab95f into auth0:main Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants