accept Microsoft's token responses by default#326
Open
lovasoa wants to merge 1 commit intoramosbugs:mainfrom
Open
accept Microsoft's token responses by default#326lovasoa wants to merge 1 commit intoramosbugs:mainfrom
lovasoa wants to merge 1 commit intoramosbugs:mainfrom
Conversation
add support for string-encoded `expires_in` for Azure AD compatibility While [RFC 6749 Section 5.1](https://tools.ietf.org/html/rfc6749#section-5.1) describes `expires_in` as an integer, Microsoft Azure AD returns this value as a string (e.g., `"3600"` instead of `3600`). This non-compliant behavior has been a [known issue since at least 2022](https://feedback.azure.com/d365community/idea/7772fd95-26e6-ec11-a81b-0022484ee92d), yet remains unresolved. Given that Microsoft Azure AD is one of the largest OAuth 2.0 identity providers globally, rejecting their token responses due to this technical violation creates a barrier to adoption. Many enterprise applications depend on Azure AD for authentication, making this workaround necessary for real-world compatibility. This change implements a lenient deserializer that accepts both the standard integer format and Azure's string format, ensuring the library works with RFC-compliant providers while maintaining compatibility with Azure. The fix is transparent to users - existing code continues to work without modification - and adds test coverage for both formats. fixes ramosbugs#191
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
add support for string-encoded
expires_infor Azure AD compatibilityWhile RFC 6749 Section 5.1 describes
expires_inas an integer, Microsoft Azure AD returns this value as a string (e.g.,"3600"instead of3600). This non-compliant behavior has been a known issue since at least 2022, yet remains unresolved.Given that Microsoft Azure AD is one of the largest OAuth 2.0 identity providers globally, rejecting their token responses due to this technical violation creates a barrier to adoption. Many enterprise applications depend on Azure AD for authentication, making this workaround necessary for real-world compatibility.
This change implements a lenient deserializer that accepts both the standard integer format and Azure's string format, ensuring the library works with RFC-compliant providers while maintaining compatibility with Azure. The fix is transparent to users - existing code continues to work without modification - and adds test coverage for both formats.
fixes #191