Skip to content
This repository has been archived by the owner on Feb 16, 2022. It is now read-only.

Add missing user fields provided by Twitter #197

Merged
merged 1 commit into from
Mar 23, 2021
Merged

Add missing user fields provided by Twitter #197

merged 1 commit into from
Mar 23, 2021

Conversation

mlafeldt
Copy link
Contributor

See https://developer.twitter.com/en/docs/twitter-api/v1/data-dictionary/object-model/user

Here's the raw JSON for my Twitter account copied from the Auth0 console:

{
    "created_at": "2021-02-09T17:32:08.973Z",
    "description": "Freelance cloud consultant by day. Aspiring product builder by night.",
    "identities": [
        {
            "provider": "twitter",
            "user_id": "295919262",
            "connection": "twitter",
            "isSocial": true
        }
    ],
    "location": "Hamburg 🇩🇪",
    "name": "Mathias Lafeldt",
    "nickname": "Mathias Lafeldt",
    "picture": "https://pbs.twimg.com/profile_images/1069419719227146240/e8l9msvL_normal.jpg",
    "screen_name": "mlafeldt",
    "updated_at": "2021-02-11T08:56:51.590Z",
    "url": "https://t.co/jXqmcnVmL5",
    "user_id": "twitter|295919262",
    "blocked": false,
    "last_ip": "1.2.3.4",
    "last_login": "2021-02-10T22:10:18.916Z",
    "logins_count": 3,
    "blocked_for": [],
    "guardian_authenticators": []
}

@mlafeldt mlafeldt changed the title Add missing user fields provider by Twitter Add missing user fields provided by Twitter Feb 12, 2021
@@ -98,7 +110,6 @@ type User struct {
//
// We have to use a custom one due to possible inconsistencies in value types.
func (u *User) UnmarshalJSON(b []byte) error {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those whitespace changes were done by gofumpt. I can revert them if you want.

@mlafeldt
Copy link
Contributor Author

@alexkappa Could you please merge this and #196? A new tag would also be appreciated. 😊

@mlafeldt
Copy link
Contributor Author

mlafeldt commented Mar 3, 2021

🙏

Copy link
Contributor

@jbauth0 jbauth0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ... I'm pretty sure there are only restrictions on reserved root level fields. I don't know if there is a definitive list of these fields but for example a custom saml assertion attribute will just get added at the root level unless a Rule maps it elsewhere.

@yvovandoorn yvovandoorn merged commit e2b5a61 into go-auth0:master Mar 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants