[GH-ISSUE #588] TokenCompletionHandler never called #381

Closed
opened 2026-03-03 16:48:13 +03:00 by kerem · 0 comments
Owner

Originally created by @vinhtnk on GitHub (Apr 26, 2020).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/588

Description:

TokenCompletionHandler never called

OAuth Provider? (Twitter, Github, ..): my server use OAuth2

Here my code:

  let oauthswift = OAuth2Swift(
        consumerKey: CLIENT_ID,
        consumerSecret: CLIENT_SECRET,
        authorizeUrl: AUTH_URL,
        responseType: kCode
    )
    self.oauthswift = oauthswift
    oauthswift.accessTokenBasicAuthentification = true
    oauthswift.allowMissingStateCheck = true
    oauthswift.authorizeURLHandler = self.handleURlSafari()
    let _ = oauthswift.authorize(
        withCallbackURL: URL(string: https://example.com/callback)!,
        scope: SCOPE,
        state:state,
        codeChallenge: challengeCode,
        codeChallengeMethod: kS256,
        codeVerifier: verifyCode) { result in
            switch result {
            case .success(let (credential, response, parameters)):
                print(credential.oauthToken)
                print(response as Any)
                print(parameters)
                print("OAuth callback =====>")
            case .failure(let error):
                print(error.localizedDescription)
            }
    }

OAuth Version:

  • Version 1
  • Version 2

OS (Please fill the version) :

  • iOS :
  • OSX :
  • TVOS :
  • WatchOS :

Installation method:

  • Carthage
  • CocoaPods
  • Swift Package Manager
  • Manually

Library version:

  • head
  • v2.1.0
  • v2.0.0
  • v1.4.1
  • v1.2 (Swift 4.0)
  • other: (Please fill in the version you are using.)

Xcode version:

  • 11.x (Swift 5.1)

  • 10.x (Swift 5.0)

  • 10.x (Swift 4.1)

  • 9.3 (Swift 4.1)

  • 9.0 (Swift 4.0)

  • other: (Please fill in the version you are using.)

  • objective c

Originally created by @vinhtnk on GitHub (Apr 26, 2020). Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/588 ### Description: TokenCompletionHandler never called ### OAuth Provider? (Twitter, Github, ..): my server use OAuth2 Here my code: let oauthswift = OAuth2Swift( consumerKey: CLIENT_ID, consumerSecret: CLIENT_SECRET, authorizeUrl: AUTH_URL, responseType: kCode ) self.oauthswift = oauthswift oauthswift.accessTokenBasicAuthentification = true oauthswift.allowMissingStateCheck = true oauthswift.authorizeURLHandler = self.handleURlSafari() let _ = oauthswift.authorize( withCallbackURL: URL(string: https://example.com/callback)!, scope: SCOPE, state:state, codeChallenge: challengeCode, codeChallengeMethod: kS256, codeVerifier: verifyCode) { result in switch result { case .success(let (credential, response, parameters)): print(credential.oauthToken) print(response as Any) print(parameters) print("OAuth callback =====>") case .failure(let error): print(error.localizedDescription) } } ### OAuth Version: - [ ] Version 1 - [x] Version 2 ### OS (Please fill the version) : - [x] iOS : - [ ] OSX : - [ ] TVOS : - [ ] WatchOS : ### Installation method: - [ ] Carthage - [x] CocoaPods - [ ] Swift Package Manager - [ ] Manually ### Library version: - [ ] head - [ ] v2.1.0 - [x] v2.0.0 - [ ] v1.4.1 - [ ] v1.2 (Swift 4.0) - [ ] other: (Please fill in the version you are using.) ### Xcode version: - [x] 11.x (Swift 5.1) - [ ] 10.x (Swift 5.0) - [ ] 10.x (Swift 4.1) - [ ] 9.3 (Swift 4.1) - [ ] 9.0 (Swift 4.0) - [ ] other: (Please fill in the version you are using.) - [ ] objective c
kerem closed this issue 2026-03-03 16:48:13 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/OAuthSwift#381
No description provided.