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 loop when request authorize endpoint with max_age=0 #1229

Closed
tiagofe opened this issue Apr 23, 2024 · 3 comments
Closed

Login loop when request authorize endpoint with max_age=0 #1229

tiagofe opened this issue Apr 23, 2024 · 3 comments

Comments

@tiagofe
Copy link

tiagofe commented Apr 23, 2024

Which version of Duende IdentityServer are you using? Duende 7.0.4

Which version of .NET are you using? 8

Describe the bug

With the Duende version 7, every time we call authorize endpoint using max_age=0, it starts a loop asking to login again and again.
After investigation, comparing the behavior with the version 6.3.8, it seems the Clock.UtcNow.UtcDateTime in AuthorizeInteractionResponseGenerator contains millisecconds part, but in Duende 6.3.8 it is always 0 milliseconds.

This causes to enter in a loop trying to login again and again.

To Reproduce

Call authorize endpoint using max_age=0

Expected behavior

It should ask for login one time only.

Log output/exception with stacktrace

Additional context

Here I add some logs only to compare versions:

Duende 6.3.8 (inside max_age datetime validation) ->
image

Duende 7.0.4 (inside max_age datetime validation) ->
image

Seems the Clock.UtcNow.UtcDateTime contains the milliseconds, but in Duende 6 it was using ISystemClock. and it seems before the milliseconds was 0.

Then, with Duende 7.0.4, and since Clock.UtcNow.UtcDateTime is greater then authTime, it will ask again for login.

@pecanw
Copy link

pecanw commented Apr 29, 2024

Proposed solution - see the pull request

@RolandGuijt
Copy link

Thanks for the PR!
I've created an issue in the IdentityServer repo for this. I'm closing this support issue - further tracking can be done from there.

@josephdecock
Copy link
Member

Also, a work-around while we get this fixed is to use prompt=login instead of max_age=0.

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

No branches or pull requests

4 participants