Skip to content

Commit

Permalink
Prevent infinite loop when max_age=0
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr Waclawek authored and Petr Waclawek committed Apr 23, 2024
1 parent 3527069 commit 0e1fdab
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -244,6 +244,9 @@ protected internal virtual async Task<InteractionResponse> ProcessLoginAsync(Val
var authTime = request.Subject.GetAuthenticationTime();
if (Clock.UtcNow.UtcDateTime > authTime.AddSeconds(request.MaxAge.Value))
{
// Remove the max_age parameter to prevent (infinite) loop
request.Raw.Remove("max_age");

Logger.LogInformation("Showing login: Requested MaxAge exceeded.");

return new InteractionResponse { IsLogin = true };
Expand Down

0 comments on commit 0e1fdab

Please sign in to comment.