-
Notifications
You must be signed in to change notification settings - Fork 218
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
[Question] Token expiration #1593
Comments
The problem is probably related to the line : options.UseTokenLifetime = true; I think this is the reason why the cookie lifetime is not used. Another question,, what are the differences between these two properties ? |
@TanguyPa is this still repro-ing in the latest version 2.15.5?
basically, |
Hello, The problem is that the form data are lost and the POST request sent too. Have you ever had users encounter similar problems, and do you have any recommendations? Currently, to avoid these problems, I've set up middleware that saves the request in a cache before the user is redirected to be authenticated and then the request is re-executed once the user re-authenticates. |
I don't really understand the current behavior. |
I solved the problem by taking a closer look at the various logs. |
Which version of Microsoft Identity Web are you using?
1.18.0
Where is the issue?
Is this a new or an existing app?
c. This is a new app or an experiment.
Repro
I use these attributes for the controller
ASP MVC Core 5.0
Expected behavior
I would like the id token to be valid for 14 days (and refreshed after 7 via the SlidingExpiration attribute) so that a user can leave a page open for a long time without risking the loss of his data after submitting a form.
Actual behavior
The user is forced to reconnect after ~20 min without having been active on a page. If the request is an ajax request, a CORS error is returned because an attempt is made to redirect to the identity provider.
If the request is a post via a classic form, the form data is lost.
Additional context / logs / screenshots / link to code
It seems that the expiration of the id token from the distributedcache is ~1h :
"iat": 1641970662,
"nbf": 1641970662,
"exp": 1641974562,
The access token is valid ~1h-1h30 and the refresh token 90 days ?
Can the expiration of the id token be the cause of this redirection to the identity provider? If yes, is it possible to ask the identity provider for an id token with a higher expiration time?
The text was updated successfully, but these errors were encountered: