mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-26 20:55:57 +03:00
[GH-ISSUE #631] OAuth2 fails with Polar. Client-id and secret shouldn't be sent when retrieving access token #414
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#414
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 @pepejeria on GitHub (Oct 30, 2020).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/631
Description:
OAuth2 fails for Polar because client-id and secret is sent in the body when posting to the access token URL
OAuth Provider? (Twitter, Github, ..):
Polar
OAuth Version:
OS (Please fill the version) :
Installation method:
Library version:
Xcode version:
The Polar API expect the following values when posting to access token URL:
https://www.polar.com/accesslink-api/?javascript--nodejs#token-endpoint
Any other values provided and the request will fail. The library also sends the client_id and client_secret, resulting in an invalid request.
I did the following modification to OAuthSwiftClient line 85:
to remove those values and now the request works fine.
Is there a way to solve this without having to subclass
OAuthSwiftClient? Not quite sure how I can subclassOAuth2Swiftto set a differentclientof typeOAuthSwiftClient.@pepejeria commented on GitHub (Oct 30, 2020):
Subclassed
OAuthSwiftClient, but I don't see how I can subclass OAuth2Swift as well to use this client instead.@pepejeria commented on GitHub (Oct 30, 2020):
Ok, I solved this by doing the following: