stonith404/pocket-id

๐Ÿ› Bug Report: "name" is not included in user info

Closed this issue ยท 4 comments

Reproduction steps

When I try to use an application that looks for "name" instead of "given_name" and "family_name" in the profile claim, it errors out.

Expected behavior

"name" should be constructed from "given_name" and "family_name" and included in the profile claim

Actual Behavior

Application errors out that no username was returned. This is a slight bug on the application side, but "name" should be included in any case.

suggest fixing by adding "name": user.FirstName + " " + user.LastName, to

profileClaims := map[string]interface{}{

Thanks, I've added it in v0.4.1.

I have updated to v0.4.1 and when using PocketID with Cloudflare Zero Trust, I am still not seeing the name being passed through to user email. Here's an idea of the fields that cloudflare gets with PocketID vs other providers (fields only, content removed- the fields are what's important here)

With PocketID:

{
  "id": "",
  "email": "",
  "idp": { "id": "", "type": "" },
  "geo": { "country": "" },
  "user_uuid": "",
  "account_id": "",
  "iat": 0,
  "ip": "",
  "auth_status": "",
  "common_name": "",
  "is_warp": false,
  "is_gateway": false,
  "version": 0,
  "device_sessions": {},
  "custom": {}
}

Compared to when using another identity provider:

{
  "id": "",
  "email": "",
  "name": "",
  "givenName": "",
  "surName": "",
  "idp": { "id": "", "type": "" },
  "geo": { "country": "" },
  "user_uuid": "",
  "account_id": "",
  "iat": 0,
  "ip": "",
  "auth_status": "",
  "common_name": "",
  "is_warp": false,
  "is_gateway": false,
  "version": 0,
  "device_sessions": {},
  "custom": {}
}

@danielgraycode You probably forgot to add those claims in Cloudflare:
image

The following claims are supported: "sub", "given_name", "family_name", "name", "email", "preferred_username"