-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvement spark delta-sharing client: convert expires_in as string …
…to int, if returned as string (#631) TL;DR This PR improves oauth-client in spark-client to support parsing expires_in as string similar to the changes for the python client: #628 Detail: This PR enhances the OAuth client to support cases where the expires_in field in the token response is returned as a string instead of an integer. While the OAuth 2.0 specification mandates that expires_in should be an integer [RFC 6749 Section 4.1.4](https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.4), some OAuth servers return it as a string, leading to potential compatibility issues. Certain OAuth implementations deviate from the standard and return expires_in as a string, e.g.: ``` { "access_token": "example-token", "expires_in": "3600", // Returned as a string "token_type": "Bearer" } ``` This causes failures when the client expects the field to always be an integer. Solution This PR updates the token parsing logic to: 1. Check the type of the expires_in field. 2. Convert the value to an integer if it is provided as a string. 3. Maintain backward compatibility with the standard integer format.
- Loading branch information
Showing
2 changed files
with
86 additions
and
32 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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