mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-26 12:45:52 +03:00
[GH-ISSUE #677] OAuthSwiftClient/requestWithAutomaticAccessTokenRenewal with YouTube Data API (v3) #437
Labels
No labels
bug
cocoapod
duplicate
enhancement
feature-request
help wanted
help wanted
invalid
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/OAuthSwift#437
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @appsird on GitHub (Sep 23, 2021).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/677
Description:
OAuth Provider? :
YouTube Data API (v3)
OAuth Version:
OS (Please fill the version) :
Installation method:
Library version:
Xcode version:
11.4 (Swift 5.2)
11.x (Swift 5.1)
10.x (Swift 5.0)
[ x] other: (Swift 5.5, Xcode 13)
objective c
The function OAuthSwiftClient/requestWithAutomaticAccessTokenRenewal sends a request, and if the access token has timed out (typically 60 minutes or so) - obtains a new access token and then retries the originally passed request. This works exactly in this manner. However, for the Google YouTube Data API (v3) the access token is sent in the Header of each request. Hence, the retry of a request should use the newly acquired access token in the header. Currently, it re-uses the old access token.
I am uncertain if this is relevant to other Oauth2 API access, and did not check in the appropriate change. In OAuthSwiftClient/requestWithAutomaticAccessTokenRenewal (near line 302) I added the following line to create the updated header containing the refreshed access token for the retry. This then works as needed for the Google YouTube Data API (v3).
Would appreciate if this could be integrated without affecting other API's. Assistance welcome.