mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-26 12:45:52 +03:00
[GH-ISSUE #663] new Withings token refresh endpoint breaks OAuthSwift #431
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#431
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 @ceramicatheist on GitHub (May 27, 2021).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/663
Description:
Withings recently sent out this announcement to their api users:
with more detail here: https://support.withings.com/hc/en-us/articles/360016745358-Deprecating-access-and-refresh-tokens-endpoints
and here: http://developer.withings.com/api-reference#operation/oauth2-refreshaccesstoken
Unfortunately, the new endpoint:
action, with value "requesttoken"grant_typeto equal "refresh_token" (not "authorization_code");bodyandstatus, with the former keys, includingcode, all in an object down belowbody.This breaks OAuthSwift. The parameters it sends when getting or renewing an access token are wrong, and so Withings responds with an error. Looking at the source, it's also clear that the new response format would not be correctly parsed.
Handling of the above is all hard-coded in OAuthSwift, with no obvious way to override with e.g. a subclass: while certain functions are
open, the functions they themselves call are private, so I can't intercept either the parameter construction or the response parsing. I reviewed #628, and it does not address the problem: non-public methods ofOAuth2Swiftmake replacing the relevant methods not possible.What should be done here? Is this properly dealt with at the OAuthSwift end or the Withings end? Could there be a strategy for handling this bizarre token-refresh endpoint that I'm not seeing?
I will send Withings a note pointing at this ticket to see if they have anything to contribute.
OAuth Provider:
Withings
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)
other: (Please fill in the version you are using.)
objective c
@phimage commented on GitHub (May 27, 2021):
We are open to code modification if they not break other services
It could be some way to
overrideand some variable to configure for this specific service ( aboolfor instance, there is already some, yes because no body was to use same spec 😭 )Making all public/open could make code less maintenable and have a lot of breaking change. So it depends.
So I prefer new parameter with default value, or configuration var when possible