IdentityServer4 icon indicating copy to clipboard operation
IdentityServer4 copied to clipboard

Authorized Access Token Always Expired

Open atpyk opened this issue 9 years ago • 4 comments

I've had Idsvr4 and MVC client portal, I used Microsoft.AspNetCore.Authentication.OpenIdConnect to do the oidc. I ran into an weird issue is below: After login and the authorize finished, the page would keep loading and could not redirect to the "http://clientportal/signin-oidc". Eventually it would show the "504 Gateway Time-out" page.

No error log in Idsvr side, the client portal side's log is:

fail: Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectMiddleware[17] Exception occurred while processing message. Microsoft.IdentityModel.Tokens.SecurityTokenExpiredException: IDX10223: Lifetime validation failed. The token is expired. ValidTo: '01/22/2017 01:00:59' Current time: '01/22/2017 01:05:59'. at Microsoft.IdentityModel.Tokens.Validators.ValidateLifetime(Nullable1 notBefore, Nullable1 expires, SecurityToken securityToken, TokenValidationParameters validationParameters) at System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.ValidateLifetime(Nullable1 notBefore, Nullable1 expires, JwtSecurityToken securityToken, TokenValidationParameters validationParameters) at System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.ValidateTokenPayload(JwtSecurityToken jwt, TokenValidationParameters validationParameters) at System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.ValidateToken(String token, TokenValidationParameters validationParameters, SecurityToken& validatedToken) at Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler.ValidateToken(String idToken, AuthenticationProperties properties, TokenValidationParameters validationParameters, JwtSecurityToken& jwt) at Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler.d__20.MoveNext() info: Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectMiddleware[4] Error from RemoteAuthentication: IDX10223: Lifetime validation failed. The token is expired. ValidTo: '01/22/2017 01:00:59' Current time: '01/22/2017 01:05:59'..

atpyk avatar Jan 23 '17 01:01 atpyk

Probably a clock mismatch between token issuer and consumer

leastprivilege avatar Jan 23 '17 11:01 leastprivilege

Any update on the issue? closing for now - feel free to re-open if it needs further discussion.

leastprivilege avatar Feb 05 '17 14:02 leastprivilege

@leastprivilege it's the issue of .net core 1.1.0. I have worked around. 1121

atpyk avatar Feb 20 '17 01:02 atpyk

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Jan 15 '20 01:01 lock[bot]