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:
parent
43943aeee9
commit
ce0b669348
@ -6,7 +6,6 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/mail"
|
"net/mail"
|
||||||
"net/url"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@ -195,12 +194,9 @@ type OIDCClaims struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *OIDCClaims) Identifier() string {
|
func (c *OIDCClaims) Identifier() string {
|
||||||
if strings.HasPrefix(c.Iss, "http") {
|
trimmedIss := strings.TrimRight(c.Iss, "/")
|
||||||
if i, err := url.JoinPath(c.Iss, c.Sub); err == nil {
|
trimmedSub := strings.TrimLeft(c.Sub, "/")
|
||||||
return i
|
return trimmedIss + "/" + trimmedSub
|
||||||
}
|
|
||||||
}
|
|
||||||
return c.Iss + "/" + c.Sub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type OIDCUserInfo struct {
|
type OIDCUserInfo struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user