mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-26 20:55:57 +03:00
[GH-ISSUE #674] Allow accessTokenBasicAuthentification option with OAuth2 #436
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#436
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 @AAudusseau on GitHub (Aug 25, 2021).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/674
Description:
Is there a reason why we cannot use the
accessTokenBasicAuthentificationoption when calling therenewAccessTokenfunction from the OAuth2Swift class?If we previously set the option when retrieving a token for the first time, it seems logical to reuse the option when refreshing the token.
OAuth Provider? (Twitter, Github, ..):
Custom
OAuth Version:
OS (Please fill the version) :
Installation method:
Library version:
Xcode version:
@sholt147 commented on GitHub (Sep 23, 2021):
In case it helps, I have solved this issue by modifying OAuth2Swift.swift renewAccessToken() so that it passes self.accessTokenBasicAuthentification. So now that looks like:
return self.client.renewAccessToken(accessTokenUrl: self.accessTokenUrl, withRefreshToken: refreshToken, parameters: parameters ?? OAuthSwift.Parameters(), headers: headers, accessTokenBasicAuthentification: self.accessTokenBasicAuthentification, completionHandler: completion)
While I dislike modifying framework code, I have to do it for OauthSwift anyway in order to get it to work correctly on MacCatalyst (issue #634).