diff --git a/token.go b/token.go index d8c10e06..a5e25904 100644 --- a/token.go +++ b/token.go @@ -104,7 +104,7 @@ func ParseWithClaims(tokenString string, claims Claims, keyFunc Keyfunc, options // Deprecated: In a future release, we will demote this function to a non-exported function, since it // should only be used internally func EncodeSegment(seg []byte) string { - return strings.TrimRight(base64.URLEncoding.EncodeToString(seg), "=") + return strings.TrimRight(base64.RawURLEncoding.EncodeToString(seg), "=") } // DecodeSegment decodes a JWT specific base64url encoding with padding stripped