I'm new to IdentityServer 4 and OpenIdConnect, trying to get my Asp.NET Core + Angular 9 SPA app to work with JwtBearer tokens, and the problem is what I cannot set my access_token's 'aud' claim properly, I'm getting 401 with message:
Bearer error="invalid_token", error_description="The audience 'empty' is invalid
The audience 'empty' is invalid
found in WWW-Authenticate header.
If however, instead of this I will use an id_token
constantly (which should be used only once to log user into the app as I suppose), I will get access to my protected resources, because it has this 'aud' claim.
I suppose it is not a proper behaviour (or is it?)
Is there any way, how I may explicitly set the access_token's 'aud' claim? I've looked already in many places, stackOverflow, OpenId.net docs and the others, and still I cannot find an answer. May some1 help me with that?
Here's my AddAuthentication method in my API & app.UseAuthentication/app.UseAuthorization: https://pastebin.com/YdE3WQ7b
and my client config: https://pastebin.com/AdAjntjc
PrintScreen of jwt.io: