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

feat (oidc): better error for max age #75

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

jimlambrt
Copy link
Collaborator

No description provided.

@jimlambrt jimlambrt requested a review from austingebauer June 6, 2023 16:47
Copy link
Contributor

@austingebauer austingebauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@@ -556,7 +556,7 @@ func (p *Provider) VerifyIDToken(ctx context.Context, t IDToken, oidcRequest Req
}
authTime := time.Unix(int64(atClaim), 0)
if !authTime.Add(leeway).After(authAfter) {
return nil, fmt.Errorf("%s: auth_time (%s) is beyond max age (%d): %w", op, authTime, secs, ErrExpiredAuthTime)
return nil, fmt.Errorf("%s: issued at (%s) is beyond max age (%d / %s): %w", op, authTime, secs, authAfter, ErrExpiredAuthTime)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I think keeping auth_time is more precise since it can be different from the issued at (iat) claim.

@jimlambrt jimlambrt merged commit e8a0b02 into main Jun 6, 2023
@jimlambrt jimlambrt deleted the jimlambrt-better-max-age-info branch June 6, 2023 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants