[GH-ISSUE #349] Error Info : The operation couldn’t be completed. (OAuthSwiftError error -10.) #222

Closed
opened 2026-03-03 16:46:47 +03:00 by kerem · 11 comments
Owner

Originally created by @megifernanda on GitHub (Mar 10, 2017).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/349

Description:

screen shot 2017-03-10 at 4 14 49 pm

i want to test Authorize

OAuth Provider (Twitter, Github, ..):

no provider

OAuth Version:

  • Version 1
  • Version 2

OS (Please fill the version) :

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

Installation method:

  • Carthage
  • CocoaPods
  • Manually

Library version:

  • head
  • v1.0.0
  • v0.6
  • other: (i dont know what version.)

Xcode version:

  • 8.0 (Swift 3.0)

  • 8.0 (Swift 2.3)

  • 7.3.1

  • other: (Version 8.2.1)

  • objective c

Originally created by @megifernanda on GitHub (Mar 10, 2017). Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/349 ### Description: <img width="568" alt="screen shot 2017-03-10 at 4 14 49 pm" src="https://cloud.githubusercontent.com/assets/25347608/23790448/ab134138-05b1-11e7-922f-2991c0dd6e0b.png"> i want to test Authorize ### OAuth Provider (Twitter, Github, ..): no provider ### OAuth Version: - [x] Version 1 - [ ] Version 2 ### OS (Please fill the version) : - [x] iOS : - [ ] OSX : - [ ] TVOS : - [ ] WatchOS : ### Installation method: - [x] Carthage - [x] CocoaPods - [ ] Manually ### Library version: - [ ] head - [ ] v1.0.0 - [ ] v0.6 - [x] other: (i dont know what version.) ### Xcode version: - [ ] 8.0 (Swift 3.0) - [ ] 8.0 (Swift 2.3) - [ ] 7.3.1 - [x] other: (Version 8.2.1) - [ ] objective c
kerem closed this issue 2026-03-03 16:46:48 +03:00
Author
Owner

@phimage commented on GitHub (Mar 10, 2017):

https://github.com/OAuthSwift/OAuthSwift/blob/master/Sources/OAuthSwiftError.swift
10 retain
you do not retain your oautswift object in memory

<!-- gh-comment-id:285624077 --> @phimage commented on GitHub (Mar 10, 2017): https://github.com/OAuthSwift/OAuthSwift/blob/master/Sources/OAuthSwiftError.swift 10 retain you do not retain your oautswift object in memory
Author
Owner

@megifernanda commented on GitHub (Mar 10, 2017):

and then what must i do sir ?? im really dont know what must i do

<!-- gh-comment-id:285625842 --> @megifernanda commented on GitHub (Mar 10, 2017): and then what must i do sir ?? im really dont know what must i do
Author
Owner

@phimage commented on GitHub (Mar 10, 2017):

keep a reference on oauthswift variable in your class

class ViewController: ... {
   var oauthswift: OAuth1Swift?

   func doAuXXX() {

        self.oauthswift = ...

ps: then screenshot is very bad in issue, always copy paste your code or error message
and use github markdown for code

<!-- gh-comment-id:285626722 --> @phimage commented on GitHub (Mar 10, 2017): keep a reference on `oauthswift` variable in your class ```swift class ViewController: ... { var oauthswift: OAuth1Swift? func doAuXXX() { self.oauthswift = ... ``` ps: then screenshot is very bad in issue, always copy paste your code or error message and use github markdown for code
Author
Owner

@megifernanda commented on GitHub (Mar 10, 2017):

sorry sir, i just see before me shared issue with screenshoot

and i already add variable and still -10

or this problem because my librabry get red sir
screen shot 2017-03-10 at 5 02 07 pm

      import UIKit
         import OAuthSwift

       class ViewController: UIViewController {

    var oauthswift: OAuth1Swift?
    
    override func viewDidLoad() {
        super.viewDidLoad()
        doAuthPetani()
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


    func doAuthPetani() {
        
        print ("hei")
       let oauthswift = OAuth1Swift(
        consumerKey:   "Sjt29_vS0RmK6t-QeXsieYn9Kq0.",
        consumerSecret: "YUVeUSiF_I5ZEoZLnD66dQ6pBu4Oi6D96NpyRbJ-Suo.",
        requestTokenUrl: "https://oauth.8villages.com/tokens/request-token",
        authorizeUrl:    "https://accounts.8villages.com/oauth/request-token",
        accessTokenUrl:  "https://accounts.8villages.com/oauth/access-token"
        )
        
        
        let handle = oauthswift.authorize(
            withCallbackURL: URL(string: "OauthTest://oauth-callback")!,
            success: { credential, response, parameters in
                    print ("menda")
        
        },
            failure: { error in
                print ("a")
                print(error.localizedDescription)
        }             
        )

      }
     }
<!-- gh-comment-id:285628175 --> @megifernanda commented on GitHub (Mar 10, 2017): sorry sir, i just see before me shared issue with screenshoot and i already add variable and still -10 or this problem because my librabry get red sir <img width="256" alt="screen shot 2017-03-10 at 5 02 07 pm" src="https://cloud.githubusercontent.com/assets/25347608/23790831/55da01d2-05b3-11e7-91b1-9c5b74b1ed0e.png"> ```swift import UIKit import OAuthSwift class ViewController: UIViewController { var oauthswift: OAuth1Swift? override func viewDidLoad() { super.viewDidLoad() doAuthPetani() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } func doAuthPetani() { print ("hei") let oauthswift = OAuth1Swift( consumerKey: "Sjt29_vS0RmK6t-QeXsieYn9Kq0.", consumerSecret: "YUVeUSiF_I5ZEoZLnD66dQ6pBu4Oi6D96NpyRbJ-Suo.", requestTokenUrl: "https://oauth.8villages.com/tokens/request-token", authorizeUrl: "https://accounts.8villages.com/oauth/request-token", accessTokenUrl: "https://accounts.8villages.com/oauth/access-token" ) let handle = oauthswift.authorize( withCallbackURL: URL(string: "OauthTest://oauth-callback")!, success: { credential, response, parameters in print ("menda") }, failure: { error in print ("a") print(error.localizedDescription) } ) } } ```
Author
Owner

@phimage commented on GitHub (Mar 10, 2017):

not let oauthswift = OAuth1Swift(

but self.oauthswift = OAuth1Swift(
to use your class variable

let oauthswift = OAuth1Swift(


self.oauthswift = oauthswift

if you don't know how to use optional

<!-- gh-comment-id:285628872 --> @phimage commented on GitHub (Mar 10, 2017): not `let oauthswift = OAuth1Swift(` but `self.oauthswift = OAuth1Swift(` to use your class variable ``` let oauthswift = OAuth1Swift( self.oauthswift = oauthswift ``` if you don't know how to use optional
Author
Owner

@megifernanda commented on GitHub (Mar 10, 2017):

its run sir, but i want ask. what is my urlcallback right?

<!-- gh-comment-id:285631311 --> @megifernanda commented on GitHub (Mar 10, 2017): its run sir, but i want ask. what is my urlcallback right?
Author
Owner

@phimage commented on GitHub (Mar 10, 2017):

please read the readme

your provider 8villages will return information to login using this url
when opening this url your app will call oauthswift.handle(url), and your login is done

<!-- gh-comment-id:285631681 --> @phimage commented on GitHub (Mar 10, 2017): please read the readme your provider 8villages will return information to login using this url when opening this url your app will call oauthswift.handle(url), and your login is done
Author
Owner

@megifernanda commented on GitHub (Mar 10, 2017):

oke sir, and where i can see code for access token?

<!-- gh-comment-id:285632351 --> @megifernanda commented on GitHub (Mar 10, 2017): oke sir, and where i can see code for access token?
Author
Owner

@phimage commented on GitHub (Mar 10, 2017):

why you want to see it?

in your code you receive credential object

 success: { credential, response, parameters in
                    print ("menda")
<!-- gh-comment-id:285686432 --> @phimage commented on GitHub (Mar 10, 2017): why you want to see it? in your code you receive `credential` object ``` success: { credential, response, parameters in print ("menda") ```
Author
Owner

@megifernanda commented on GitHub (Mar 10, 2017):

i means, what is code for access token. i can't find it.

i can't find code for accesstoken in ViewController example

<!-- gh-comment-id:285711644 --> @megifernanda commented on GitHub (Mar 10, 2017): i means, what is code for access token. i can't find it. i can't find code for accesstoken in ViewController example
Author
Owner

@phimage commented on GitHub (Mar 12, 2017):

you don't need it...
or you want to use an other network framework
and please read my previous answer : credential ...

<!-- gh-comment-id:285944827 --> @phimage commented on GitHub (Mar 12, 2017): you don't need it... or you want to use an other network framework and please read my previous answer : credential ...
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#222
No description provided.