[GH-ISSUE #428] Error In OAuth 2.0 with Dribbble #278

Closed
opened 2026-03-03 16:47:20 +03:00 by kerem · 1 comment
Owner

Originally created by @ghost on GitHub (Jan 3, 2018).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/428

Description:

Error: error._code : -10
error.localizedDescription : "The operation couldn’t be completed. (OAuthSwiftError error -10.)"

Code:
let oauthswift = OAuth2Swift(
consumerKey: "",
consumerSecret: "
",
authorizeUrl: "https://dribbble.com/oauth/authorize",
accessTokenUrl: "https://dribbble.com/oauth/token",
responseType: "code"
)

    _ = oauthswift.authorize(
        withCallbackURL: URL(string: "oauth2://oauth-callback/dribbble")!,
        scope: "public", state: "DRIBBLE",
        success: { credential, _, _ in
            print(credential.oauthToken)
            // Do your request
    },
        failure: { error in
            print(error.localizedDescription)
    }
    )

Test Case :
working fine uptill this point and get correct url. but gives error in https://dribbble.com/oauth/token genration
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey: Any] = [:]) -> Bool {
if url.host == "oauth-callback" {
print(url.debugDescription)
OAuthSwift.handle(url: url)
}
return true
}

OAuth Provider (Twitter, Github, ..):

Dribbble

OAuth Version:

  • Version 1
  • Version 2

OS (Please fill the version) :

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

Installation method:

  • Carthage
  • CocoaPods
  • Manually

Library version:

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

Xcode version:

  • 9.0 (Swift 4.0)

  • 9.0 (Swift 3.2)

  • 8.x (Swift 3.x)

  • 8.0 (Swift 2.3)

  • 7.3.1

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

  • objective c

Originally created by @ghost on GitHub (Jan 3, 2018). Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/428 ### Description: Error: error._code : -10 error.localizedDescription : "The operation couldn’t be completed. (OAuthSwiftError error -10.)" Code: let oauthswift = OAuth2Swift( consumerKey: "****", consumerSecret: "****", authorizeUrl: "https://dribbble.com/oauth/authorize", accessTokenUrl: "https://dribbble.com/oauth/token", responseType: "code" ) _ = oauthswift.authorize( withCallbackURL: URL(string: "oauth2://oauth-callback/dribbble")!, scope: "public", state: "DRIBBLE", success: { credential, _, _ in print(credential.oauthToken) // Do your request }, failure: { error in print(error.localizedDescription) } ) Test Case : working fine uptill this point and get correct url. but gives error in https://dribbble.com/oauth/token genration func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey: Any] = [:]) -> Bool { if url.host == "oauth-callback" { print(url.debugDescription) OAuthSwift.handle(url: url) } return true } ### OAuth Provider (Twitter, Github, ..): Dribbble ### OAuth Version: - [ ] Version 1 - [x] Version 2 ### OS (Please fill the version) : - [x] iOS : - [ ] OSX : - [ ] TVOS : - [ ] WatchOS : ### Installation method: - [ ] Carthage - [x] CocoaPods - [ ] Manually ### Library version: - [ ] head - [x] v1.2 (Swift 4.0) - [ ] v1.0.0 - [ ] v0.6 - [ ] other: (Please fill in the version you are using.) ### Xcode version: - [x] 9.0 (Swift 4.0) - [ ] 9.0 (Swift 3.2) - [ ] 8.x (Swift 3.x) - [ ] 8.0 (Swift 2.3) - [ ] 7.3.1 - [ ] other: (Please fill in the version you are using.) - [ ] objective c
kerem closed this issue 2026-03-03 16:47:20 +03:00
Author
Owner

@phimage commented on GitHub (Jan 13, 2018):

see https://github.com/OAuthSwift/OAuthSwift/issues/361
you must retain oauth swift object
so no "let oauthswift = OAuth2Swift("
but "self.oauthswift = OAuth2Swift("

<!-- gh-comment-id:357469896 --> @phimage commented on GitHub (Jan 13, 2018): see https://github.com/OAuthSwift/OAuthSwift/issues/361 you must retain oauth swift object so no "let oauthswift = OAuth2Swift(" but "self.oauthswift = OAuth2Swift("
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#278
No description provided.