[Bug] email_verified Field Returned as String Causes Unmarshal Error in v0.24.0-beta.1 #880

Closed
opened 2025-12-29 02:25:10 +01:00 by adam · 0 comments
Owner

Originally created by @mitchellkellett on GitHub (Dec 14, 2024).

Is this a support request?

  • This is not a support request

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When running v0.24.0-beta.1, my IdP (JumpCloud) returns the email_verified field as a string instead of a boolean. This results in a decoding error when attempting to log in.

Error Message
failed to decode ID token claims: json: cannot unmarshal string into Go struct field OIDCClaims.email_verified of type bool

Expected Behavior

The application should handle email_verified as either a string ("true"/"false") or a boolean (true/false) to accommodate differences in IdP implementations.

Steps To Reproduce

  1. Configure JumpCloud as the IdP.
  2. Attempt to log in using v0.24.0-beta.1.
  3. Observe the error during the ID token decoding step.

Environment

- OS: Docker
- Headscale version: v0.24.0-beta.1
- Tailscale version: 1.78.1

Runtime environment

  • Headscale is behind a (reverse) proxy
  • Headscale runs in a container

Anything else?

JumpCloud JWT Decoded

{
  "at_hash": "dHPX6DeNSz-JmC6BCKrN-w",
  "aud": [
    "887f0974-fa68-426a-a634-995f2e6f0e6a"
  ],
  "auth_time": 1734209441,
  "email": "mitchell@example.com",
  "email_verified": "true",
  "exp": 1734213044,
  "family_name": "K",
  "given_name": "Mitchell",
  "groups": [
    "Headscale-Users"
  ],
  "iat": 1734209444,
  "iss": "https://oauth.id.jumpcloud.com/",
  "jc_org": "z6l26ev8ckkf1bhj",
  "jti": "9c5ef43c-efde-4836-a6d1-17ca6aff98db",
  "middle_name": "",
  "name": "Mitchell",
  "preferred_username": "mitchell",
  "rat": 1734209416,
  "sid": "84db2a08-254b-42f7-a701-4ff73e6a1e6d",
  "sub": "at8zv29er4btuzih"
}
Originally created by @mitchellkellett on GitHub (Dec 14, 2024). ### Is this a support request? - [X] This is not a support request ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current Behavior When running v0.24.0-beta.1, my IdP (JumpCloud) returns the email_verified field as a string instead of a boolean. This results in a decoding error when attempting to log in. **Error Message** `failed to decode ID token claims: json: cannot unmarshal string into Go struct field OIDCClaims.email_verified of type bool` ### Expected Behavior The application should handle email_verified as either a string ("true"/"false") or a boolean (true/false) to accommodate differences in IdP implementations. ### Steps To Reproduce 1. Configure JumpCloud as the IdP. 2. Attempt to log in using v0.24.0-beta.1. 3. Observe the error during the ID token decoding step. ### Environment ```markdown - OS: Docker - Headscale version: v0.24.0-beta.1 - Tailscale version: 1.78.1 ``` ### Runtime environment - [X] Headscale is behind a (reverse) proxy - [X] Headscale runs in a container ### Anything else? JumpCloud JWT Decoded ```json { "at_hash": "dHPX6DeNSz-JmC6BCKrN-w", "aud": [ "887f0974-fa68-426a-a634-995f2e6f0e6a" ], "auth_time": 1734209441, "email": "mitchell@example.com", "email_verified": "true", "exp": 1734213044, "family_name": "K", "given_name": "Mitchell", "groups": [ "Headscale-Users" ], "iat": 1734209444, "iss": "https://oauth.id.jumpcloud.com/", "jc_org": "z6l26ev8ckkf1bhj", "jti": "9c5ef43c-efde-4836-a6d1-17ca6aff98db", "middle_name": "", "name": "Mitchell", "preferred_username": "mitchell", "rat": 1734209416, "sid": "84db2a08-254b-42f7-a701-4ff73e6a1e6d", "sub": "at8zv29er4btuzih" } ```
adam added the bugOIDC labels 2025-12-29 02:25:10 +01:00
adam closed this issue 2025-12-29 02:25:10 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#880