OAuthSwift icon indicating copy to clipboard operation
OAuthSwift copied to clipboard

Allow accessTokenBasicAuthentification option with OAuth2

Open AAudusseau opened this issue 4 years ago • 1 comments

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:

  • [x] Version 2

OS (Please fill the version) :

  • [x] iOS : 14.6

Installation method:

  • [x] CocoaPods

Library version:

  • [x] v2.2.0

Xcode version:

  • [x] latest

AAudusseau avatar Aug 25 '21 14:08 AAudusseau

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

sholt147 avatar Sep 23 '21 15:09 sholt147