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

fix: Use correct offset in ID token expiry check #1529

Merged
merged 1 commit into from
Sep 9, 2022

Conversation

liamkeaton
Copy link
Contributor

When using a large maxIdTokenIatOffsetAllowedInSeconds the ID token is
always marked as expired. Issue #1505 found this was due to the wrong
offset being passed to the validateIdTokenExpNotExpired method. This
PR uses the renewTimeBeforeTokenExpiresInSeconds which is used in the
auth-state.service.ts hasIdTokenExpiredAndRenewCheckIsEnabled method for
a similar purpose.

When using a large maxIdTokenIatOffsetAllowedInSeconds the ID token is
always marked as expired. Issue damienbod#1505 found this was due to the wrong
offset being passed to the validateIdTokenExpNotExpired method. This
PR uses the renewTimeBeforeTokenExpiresInSeconds which is used in the
auth-state.service.ts hasIdTokenExpiredAndRenewCheckIsEnabled method for
a similar purpose.
@walter-psjr
Copy link

walter-psjr commented Sep 9, 2022

I think this has to do with an issue I am facing in my application after upgrading to angular and angular-auth-oidc-client 14 - #1522

@damienbod damienbod merged commit 2fd2ae4 into damienbod:main Sep 9, 2022
@damienbod
Copy link
Owner

Thanks @liamkeaton

@walter-psjr
Copy link

When can we have a new version with this fix @damienbod?

@andreaslarssen
Copy link
Contributor

☝️

@andreaslarssen
Copy link
Contributor

Seems like this also could be the root of #1515

@silviu-sterian
Copy link

When can we have a new version with this fix @damienbod?

@andreaslarssen this unfortunately does not fix my issue. This issue (reported above) has to do with renewTimeBeforeTokenExpiresInSeconds property and it is not solved by this release

@walter-psjr
Copy link

It worked for me with version 14.1.5

@silviu-sterian
Copy link

@walter-psjr What worked? I don't think currently renewTimeBeforeTokenExpiresInSeconds is honored, which means you should be able to renew the token - for safety - that number of seconds before it expires. Say you want to make sure you account for latency in your network and set it to 20s. Does the silent renew process start 20s before the token expires?

rafalkasa pushed a commit to rafalkasa/angular-auth-oidc-client that referenced this pull request Jan 18, 2023
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.

5 participants