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

saml: truncate issue instant to microseconds #126

Merged
merged 1 commit into from
Dec 21, 2023

Conversation

austingebauer
Copy link
Contributor

@austingebauer austingebauer commented Dec 21, 2023

This PR truncates the IssueInstant of the SAML AuthNRequest to microseconds. This enables our service provider to be compatible with SAML enterprise applications in Microsoft Entra (formerly Azure AD). I was able to reproduce the failure to parse the IssueInstant and verify this change fixes it in Vault.

This is needed because the AuthnRequest processing expects the IssueInstant to have the round-trip format ("o") which has a max of 10^-7 second precision. Go time.Now() has varying precision depending on which OS it's running on. On linux, the precision is 10^-9 (nanoseconds) which caused the parsing failure. Truncating to 10^-6 (microseconds) fixes it.

@austingebauer austingebauer requested review from jimlambrt, hcjulz and a team December 21, 2023 00:45
Copy link

@vinay-gopalan vinay-gopalan left a comment

Choose a reason for hiding this comment

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

The fix makes sense based on the explanation of the problem! Great catch, will need to be mindful of different platforms when using time.Now 😅

Copy link
Member

@robmonte robmonte left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Collaborator

@jimlambrt jimlambrt left a comment

Choose a reason for hiding this comment

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

ty

@austingebauer austingebauer merged commit 20669ce into main Dec 21, 2023
8 checks passed
@austingebauer austingebauer deleted the saml/authn-request-issue-instant branch December 21, 2023 15:17
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.

4 participants