IdentityServer4 icon indicating copy to clipboard operation
IdentityServer4 copied to clipboard

System.InvalidOperationException: auth_time is missing

Open martindrlik opened this issue 8 years ago • 11 comments

Hello guys, we are using IdentityServer4 version 2.2.0 and at some point (I have no steps to reproduce) we are getting following log entry:

System.InvalidOperationException: auth_time is missing.
   at IdentityServer4.Extensions.PrincipalExtensions.GetAuthenticationTimeEpoch(IIdentity identity)
   at IdentityServer4.Services.DefaultClaimsService.GetStandardSubjectClaims(ClaimsPrincipal subject)
   at IdentityServer4.Services.DefaultClaimsService.<GetIdentityTokenClaimsAsync>d__3.MoveNext()

I'll improve issue description if needed, but currently I have no more information :-(

martindrlik avatar Jun 13 '18 13:06 martindrlik

We are still getting auth_time is missing critical log entry. It seems only while user is logging in. Except that critical log entry there seems to be no other issue.

Might be that I missed something but otherwise it looks like we are setting authentication time anywhere relevant.

I did reopen this issue. I still looking for clarification or otherwise to get rid of this issue.

martindrlik avatar Jul 29 '18 09:07 martindrlik

You still have no steps to repro, so there's nothing we can do to investigate.

brockallen avatar Jul 29 '18 13:07 brockallen

Any update?

brockallen avatar Jul 31 '18 14:07 brockallen

Sorry but still no update. We have no steps to reproduce.

martindrlik avatar Jul 31 '18 18:07 martindrlik

In that case I will close since there's no action we can take at this time. If you still have issues, and can provide repo steps, feel free to reopen.

brockallen avatar Jul 31 '18 18:07 brockallen

Hi, I have the same issue , with identity server version 2.0.0-rc1 or version 2.1.0

InvalidOperationException: auth_time is missing. IdentityServer4.Extensions.PrincipalExtensions.GetAuthenticationTimeEpoch(IIdentity identity) in PrincipalExtensions.cs, line 52

1 2

@brockallen

logcorner avatar Aug 15 '18 12:08 logcorner

@logcorner this might be the issue? https://github.com/IdentityServer/IdentityServer4/issues/2510#issuecomment-411871543

brockallen avatar Aug 15 '18 14:08 brockallen

Hi, I tried this but it does not work. It works very well if I run it without docker (F5)

But if I run it using docker ( docker-compose ) , I have an exception.

I think I have some configuartion issues Regards

Le mer. 15 août 2018 à 16:53, Brock Allen [email protected] a écrit :

@logcorner https://github.com/logcorner this might be the issue? #2510 (comment) https://github.com/IdentityServer/IdentityServer4/issues/2510#issuecomment-411871543

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/IdentityServer/IdentityServer4/issues/2382#issuecomment-413222629, or mute the thread https://github.com/notifications/unsubscribe-auth/AE1PMydOppTA_HCMzyYkdKeGBoRSAcXGks5uRDXhgaJpZM4UmMnv .

logcorner avatar Oct 26 '18 08:10 logcorner

I'm facing this issue when I run IdentityServer site with IISExpress. My client is an angular app with implicit grant flow. First authentication always happens without mistakes. To reproduce it I set small lifetime for id_token and access_token (60s and 180s), login in my application, then close tab with angular app. Then I open my angular app 15-30 mins later and try to login once again and that's how I usually reproduce it.

SolarMaximus avatar Jan 16 '19 10:01 SolarMaximus

Hi! I'm facing the same issue (auth_time missing exception when trying to login after 15-30 mins after the first login)

Backend - STS (auth server): AspNetCore 2.2 + IdentityServer 2.4.0 + AspNetIdentity Backend - Web API: AspNetCore 2.2 Frontend: Angular 7 with oidc client with implicit flow.

IS4 client configuration:

new Client
                {
                    ClientId = "webSPA",
                    ClientName = "MVC SPA Client",
                    AllowedGrantTypes = GrantTypes.Implicit,
                    AllowAccessTokensViaBrowser = true,
                    IdentityTokenLifetime = 3600,
                    AccessTokenLifetime = 3600,
                    
                    // where to redirect to after login
                    RedirectUris = { "http://localhost:5002/signin-oidc" },
                    //RedirectUris = { "http://localhost:5002", },

                    // where to redirect to after logout
                    PostLogoutRedirectUris = { "http://localhost:5002/signout-callback-oidc" },
                    AllowedCorsOrigins = { "http://localhost:5002" },
                    AllowedScopes = new List<string>
                    {
                        IdentityServerConstants.StandardScopes.OpenId,
                        IdentityServerConstants.StandardScopes.Profile,
                        JwtClaimTypes.AuthenticationTime,
                        "api1"
                    },
                    AlwaysIncludeUserClaimsInIdToken = true,
                    RequireConsent = false 
                },

Angular oidc client configuration:

openIdImplicitFlowConfiguration.stsServer = 'http://localhost:5000';
openIdImplicitFlowConfiguration.redirect_url = originUrl + 'signin-oidc';
openIdImplicitFlowConfiguration.client_id = 'webSPA';
openIdImplicitFlowConfiguration.response_type = 'id_token token';
openIdImplicitFlowConfiguration.scope = 'openid profile api1';
openIdImplicitFlowConfiguration.post_logout_redirect_uri = originUrl + 'signout-callback-oidc';
openIdImplicitFlowConfiguration.forbidden_route = '/forbidden';
openIdImplicitFlowConfiguration.unauthorized_route = '/unauthorized';
openIdImplicitFlowConfiguration.auto_userinfo = true;
openIdImplicitFlowConfiguration.log_console_warning_active = true;
openIdImplicitFlowConfiguration.log_console_debug_active = true;
openIdImplicitFlowConfiguration.max_id_token_iat_offset_allowed_in_seconds = 10;

packe100 avatar May 12 '19 20:05 packe100

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 11 '20 12:01 lock[bot]