Hi i am using identity server 4 and i created a client which is protected using client_credentials
I am able to retrieve a token using the clientid and secret, and according to jwt.io the expiry of the access token is 3600 seconds or (1 hour)
on the net core 2.2 api i have a custom AuthorizationHandler
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, ClientCredentialRequirement requirement)
{
if (requirement.AllowedClients != null && requirement.AllowedClients.Any()) {
if (context.User.Identity.IsAuthenticated) { // this is false
context.Succeed(requirement);
return Task.CompletedTask;
}
should this return false when using client credentials? i was expecting it to be true since the token is valid