Using kong-jwt2header plugin to get the claims in upstream

Hi team,

I have installed the kong-jwt2header plugin in the Kong with configuration config.token_required=true.

I also have configured the Identity service in kong which is used to generate the JWT token. As we set the config.token_required=true in kong-jwt2header plugin throws an error: {"error": "No valid JWT token found"} while requesting a JWT token from the Identity service.

Now I have two options

  1. Set the config.token_required=false Or
  2. Keep the Identity service outside the Kong gateway.
    So that JWT token is not required while requesting a token from an identity service.

Which is the best way from the above two? Or are there any better ways we can send the claims upstream?

Thanks,
Saurabh

Please Suggest us something.