Skip to content

Support multiple date formats in managed identity flows#956

Merged
Avery-Dunn merged 2 commits intodevfrom
avdunn/date-fix
May 20, 2025
Merged

Support multiple date formats in managed identity flows#956
Avery-Dunn merged 2 commits intodevfrom
avdunn/date-fix

Conversation

@Avery-Dunn
Copy link
Copy Markdown
Contributor

Fixes the issue described in #873, similar to the issue and fix in MSAL .NET: AzureAD/microsoft-authentication-library-for-dotnet#4964

The expires_on value returned in a response during managed identity flows could be a simple Unix epoch timestamp or an ISO 8601 formatted date, though the current implementation only handles the timestamp.

This PR adds support for the missing date formats, clearer exception message, and tests for the new parsing method as well a mocked MI flow.

@Avery-Dunn Avery-Dunn requested a review from a team as a code owner May 15, 2025 23:08
class DateTimeTests {

@Test
void parseUnixTimestampInSeconds() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice tests, does cover all the cases.



@ParameterizedTest
@ValueSource(strings = {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@rayluo added a similar PR, would be good to have the same level of test coverage.

@Avery-Dunn Avery-Dunn merged commit 9dddd49 into dev May 20, 2025
5 checks passed
@Avery-Dunn Avery-Dunn deleted the avdunn/date-fix branch September 15, 2025 14:27
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