JWT Validation Fails with "Invalid number of parts: Expected 3 parts; got 5" Error Message

Overview

After receiving an access token, a JWT validation fails with the error message “Invalid number of parts: Expected 3 parts; got 5”

Applies To

  • JWT validation
  • Access token format

Cause

It is possible that the validator is expecting an access token that has a payload section but returns this error because it is missing.

  • Paste the token at https://jwt.io and confirm that it does not have this middle payload section.
  • This token is still valid. It is in a different format called an opaque access token.

Solution

Include an audience parameter in the /authorize request to have a payload in the access token. See Why is my access token not a JWT? (Opaque Token) for more information about Opaque Tokens.