1
0
mirror of https://github.com/juanfont/headscale.git synced 2025-08-05 13:49:57 +02:00

Update Identifier function to not risk normalization that changes existing keys

This commit is contained in:
Naveen Prashanth 2025-05-11 19:24:55 +05:30 committed by GitHub
parent 43943aeee9
commit ce0b669348
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,7 +6,6 @@ import (
"encoding/json"
"fmt"
"net/mail"
"net/url"
"strconv"
"strings"
@ -195,12 +194,9 @@ type OIDCClaims struct {
}
func (c *OIDCClaims) Identifier() string {
if strings.HasPrefix(c.Iss, "http") {
if i, err := url.JoinPath(c.Iss, c.Sub); err == nil {
return i
}
}
return c.Iss + "/" + c.Sub
trimmedIss := strings.TrimRight(c.Iss, "/")
trimmedSub := strings.TrimLeft(c.Sub, "/")
return trimmedIss + "/" + trimmedSub
}
type OIDCUserInfo struct {