I have a similar set up and able to call backend without issues. A few things to highlight:
-
Audience has to match the string you have set as API Audience in Auth0. It doesn’t have to be a URL. In your case it has to be http://localhost:6060/ (not https://localhost:7129/) since this is the API Audience of your API in Auth0 and also in your AddJwtBearer config. Even if it doesn’t work, this is the right direction, probably the issue is with something else.
-
The authority in AddJwtBearer has a ‘/’ at the end, I have had issues with that so it is worth trying without the slash at the end of authority.
-
If you still have issues after following above, it is a good idea to use uriMatcher to see what values are sent for uri. I have noticed that the uri is just the endpoint part without the base url. For example: if the url is https://localhost:7129/api/v2/users, the uri is just /api/v2/users. If this is the case, the interceptor doesn’t attach token.
Here is a sample uriMatcher: