Bearer error="invalid_token" This aud claim is not equal to the configured aud ience"

Hello everyone,

I am trying to make a GET API Request to my server using a Token and I am getting following Error

WWW-Authenticate: Bearer error=“invalid_token”, error_description=“An error occurred while attempting to decode the Jwt: This aud claim is not equal to the configured aud
ience”, error_uri=“https://tools.ietf.org/html/rfc6750#section-3.1

any Idea ?

I am using following reqest

curl -i http://localhost:8081/hello-oauth -H “Accept: application/json” -H “Authorization: Bearer TOKEN”

Hi JS9000,

The error occurs because the audience present in the access token is not the same as the one that you are having in the JWT verifier.

You can use https://jsonwebtoken.io to decode the access token and see the audience parameter that you are sending, in order to align it with the one you have in the verifier.