Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions hscontrol/types/users_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,37 @@ func TestOIDCClaimsJSONToUser(t *testing.T) {
},
},
},
{
// From https://github.com/juanfont/headscale/issues/2333
name: "casby-oidc-claim-20250513",
jsonstr: `
{
"sub": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"iss": "https://oidc.example.com/",
"aud": "xxxxxxxxxxxx",
"preferred_username": "user001",
"name": "User001",
"email": "[email protected]",
"email_verified": true,
"picture": "https://cdn.casbin.org/img/casbin.svg",
"groups": [
"org1/department1",
"org1/department2"
]
}
`,
want: User{
Provider: util.RegisterMethodOIDC,
Name: "user001",
DisplayName: "User001",
Email: "[email protected]",
ProviderIdentifier: sql.NullString{
String: "https://oidc.example.com//xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
Copy link

Choose a reason for hiding this comment

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

There appears to be a double slash in the ProviderIdentifier URL string: https://oidc.example.com//xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. Is this intentional or should it be a single slash after the domain?

Valid: true,
},
ProfilePicURL: "https://cdn.casbin.org/img/casbin.svg",
},
},
}

for _, tt := range tests {
Expand Down
Loading