Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login using the same browser after being idle / token expired results in an exception #927

Open
sbosor opened this issue May 15, 2024 · 1 comment

Comments

@sbosor
Copy link

sbosor commented May 15, 2024

Hello!

I am using .Net 8 and I have used this package to integrate with a self hosted instance of Zitadel.

What I have noticed was that after being logged in, when the IDToken expires, I am always receiving an exception when trying to login again. This was never encountered on Firefox. Also, I am able to access my Zitadel instance.

Steps:

  1. Login with a user in either Chrome or Edge.
  2. Wait for the ID token to expire (12 hours in my case).
  3. Open a new tab and try to login in.

Result:
An exception is encountered.

The errors logged on the .NET side, in Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler is:

  1. Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectProtocolException: Message contains error: 'invalid_request', error_description: 'Errors.AuthRequest.NotFound', error_uri: 'error_uri is null'.
  2. Message contains error: 'invalid_request', error_description: 'Errors.AuthRequest.NotFound', error_uri: 'error_uri is null', status code '404'.

Configuration: I have the same configuration as the one presneted here and I am using the latest version of the Zitadel package (v.6.1.2):
https://github.com/smartive/zitadel-net/blob/main/examples/Zitadel.AspNet.AuthN/Program.cs

.AddZitadel(
            o.Authority = "...";
            o.ClientId =  "...";
            o.RequireHttpsMetadata = true;
            o.SignInScheme = IdentityConstants.ExternalScheme;
            o.SaveTokens = true;
)
.Configure(
        o =>
        {
            o.Cookie.HttpOnly = true;
            o.Cookie.IsEssential = true;
            o.Cookie.SameSite = SameSiteMode.None;
            o.Cookie.SecurePolicy = CookieSecurePolicy.Always;
        });

Another problem with this issue is that I also couldn't replicate it on my dev environment in order to try debugging it better.

@sbosor sbosor changed the title Login using the same browser after token expired results in an exception Login using the same browser after being idle / token expired results in an exception May 17, 2024
@sevensolutions
Copy link

@sbosor i found your issue here and i dont know if its related but iam experiencing something similar.

zitadel/zitadel#7961

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants