From c0b58a09b3b02595c88bb66df17aa00eb790b67b Mon Sep 17 00:00:00 2001 From: yuunaka1 Date: Wed, 5 Feb 2025 22:09:46 +0900 Subject: [PATCH] Update utils.go The body (JWS Payload) uses Base64URL encoding, not Base64 encoding. Therefore, the base64.RawURLEncoding function must be used for the decoding. --- client/rest/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/rest/utils.go b/client/rest/utils.go index ed3b85ec..2de14b33 100644 --- a/client/rest/utils.go +++ b/client/rest/utils.go @@ -84,7 +84,7 @@ func ParseBody(accessToken string) (map[string]interface{}, error) { if len(parts) != 3 { return body, fmt.Errorf("invalid access token") - } else if bytes, err := base64.RawStdEncoding.DecodeString(parts[1]); err != nil { + } else if bytes, err := base64.RawURLEncoding.DecodeString(parts[1]); err != nil { return body, err } else if err := json.Unmarshal(bytes, &body); err != nil { return body, err