markbates / markbates/goth

Auth0 provider doesn't attribute all the values to goth.User

Open
#430 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
6.6k
Forks
631
PR merge metrics
No merged PRs in 30d

Description

Hey,

so I noticed that Auth0 is sending some more data back, e.g:

```json
{
"email": "email@example.com",
"email_verified": true,
"family_name": "Example",
"given_name": "Example",
"locale": "en",
"name": "Example Example",
"nickname": "example.example",
"picture": "",
"sub": "google id or other provider id",
"updated_at": "2021-10-21T08:52:15.784Z"
}

```

but the provider seems to be reading only [these values](https://github.com/markbates/goth/blob/master/providers/auth0/auth0.go#L35):
```golang
type auth0UserResp struct {
Name string `json:"name"`
NickName string `json:"nickname"`
Email string `json:"email"`
UserID string `json:"sub"`
AvatarURL string `json:"picture"`
}
```

I want to know if other values, such as **family_name** or **given_name** are not parsed on purpose because they can be left empty by **Auth0** or if it was just overlooked?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in providers/auth0/auth0.go at auth0UserResp and trace how its fields are assigned to goth.User. Check the goth.User definition to see which requested Auth0 values it can represent. Done means the agreed fields are mapped consistently, with coverage added wherever the existing Auth0 provider tests support it.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
authentication
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.