Skip to content

Commit f757f5f

Browse files
yuunaka1rvazarkarStranDutton
authored
fix: BED-7918 - Fix access token decoding
The body (JWS Payload) uses Base64URL encoding, not Base64 encoding. Therefore, the base64.RawURLEncoding function must be used for the decoding. Co-authored-by: Rohan Vazarkar <rvazarkar@users.noreply.github.com> Co-authored-by: Stran Dutton <65475509+StranDutton@users.noreply.github.com>
1 parent ec4e551 commit f757f5f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

client/rest/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func ParseBody(accessToken string) (map[string]interface{}, error) {
8787

8888
if len(parts) != 3 {
8989
return body, fmt.Errorf("invalid access token")
90-
} else if bytes, err := base64.RawStdEncoding.DecodeString(parts[1]); err != nil {
90+
} else if bytes, err := base64.RawURLEncoding.DecodeString(parts[1]); err != nil {
9191
return body, err
9292
} else if err := json.Unmarshal(bytes, &body); err != nil {
9393
return body, err

0 commit comments

Comments
 (0)