Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow accessTokenBasicAuthentification option with OAuth2 #674

Open
5 tasks done
AAudusseau opened this issue Aug 25, 2021 · 1 comment
Open
5 tasks done

Allow accessTokenBasicAuthentification option with OAuth2 #674

AAudusseau opened this issue Aug 25, 2021 · 1 comment

Comments

@AAudusseau
Copy link

Description:

Is there a reason why we cannot use the accessTokenBasicAuthentification option when calling the renewAccessToken function 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:

  • Version 2

OS (Please fill the version) :

  • iOS : 14.6

Installation method:

  • CocoaPods

Library version:

  • v2.2.0

Xcode version:

  • latest
@sholt147
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants