The error can happen with any OAuth2 service that provides authentication and authorization.
For instance, this error occured when setting an incorrect issuer-uri
to reference the AWS Cognito Pool.
I needed to correctly set the AWS Cognito user pool Token signing key URL to https://cognito-idp.${AWS_REGION}.amazonaws.com/${USER_POOL_ID}
The USER_POOL_ID
value can be taken from the AWS console, and is generally in the following form: eu-west-3_ABcdEFGh1