[GH-ISSUE #491] Authorize throws error code -11(request error). However, same parameters work in REST Client. #322

Closed
opened 2026-03-03 16:47:41 +03:00 by kerem · 7 comments
Owner

Originally created by @Ujjwal-N on GitHub (Sep 12, 2018).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/491

Description:

OAuth Provider? (Twitter, Github, ..): Schoology

OAuth Version:

  • [ x] Version 1
  • Version 2

OS (Please fill the version) :

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

Installation method:

  • [x ] Carthage
  • CocoaPods
  • Manually

Library version:

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

Xcode version:

  • [ x] 9.3 (Swift 4.1)

  • 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

var oauthswift = OAuth1Swift(
            consumerKey:    "key",
            consumerSecret: "secret",
                        requestTokenUrl: "https://api.schoology.com/v1/oauth/request_token",
                    authorizeUrl:    "https://pausd.schoology.com/oauth/authorize?",
                    accessTokenUrl:  "https://api.schoology.com/v1/oauth/access_token"
        )
        oauthswift.allowMissingOAuthVerifier = true;
        let handle = oauthswift.authorize(
            withCallbackURL: URL(string: "oauth-swift://oauth-callback/twitter")!,
            success: { credential, response, parameters in
                print(credential.oauthToken)
                print(credential.oauthTokenSecret)
                print(parameters["user_id"])
                // Do your request
        },
            failure: { error in
                print(error.localizedDescription)
        }
  )

Here is a screenshot of Insomnia, the REST Client I was using:
screen shot 76

Any help would be appreciated!
Thanks

Originally created by @Ujjwal-N on GitHub (Sep 12, 2018). Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/491 ### Description: ### OAuth Provider? (Twitter, Github, ..): Schoology ### OAuth Version: - [ x] Version 1 - [ ] Version 2 ### OS (Please fill the version) : - [x] iOS : - [ ] OSX : - [ ] TVOS : - [ ] WatchOS : ### Installation method: - [x ] Carthage - [ ] CocoaPods - [ ] Manually ### Library version: - [x ] head - [ ] v1.2.1 - [ ] v1.2 (Swift 4.0) - [ ] v1.0.0 - [ ] v0.6 - [ ] other: (Please fill in the version you are using.) ### Xcode version: - [ x] 9.3 (Swift 4.1) - [ ] 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 ``` var oauthswift = OAuth1Swift( consumerKey: "key", consumerSecret: "secret", requestTokenUrl: "https://api.schoology.com/v1/oauth/request_token", authorizeUrl: "https://pausd.schoology.com/oauth/authorize?", accessTokenUrl: "https://api.schoology.com/v1/oauth/access_token" ) oauthswift.allowMissingOAuthVerifier = true; let handle = oauthswift.authorize( withCallbackURL: URL(string: "oauth-swift://oauth-callback/twitter")!, success: { credential, response, parameters in print(credential.oauthToken) print(credential.oauthTokenSecret) print(parameters["user_id"]) // Do your request }, failure: { error in print(error.localizedDescription) } ) ``` Here is a screenshot of Insomnia, the REST Client I was using: ![screen shot 76](https://user-images.githubusercontent.com/15056315/45406936-d09ba180-b61c-11e8-8d79-d83367d8f040.jpg) Any help would be appreciated! Thanks
kerem closed this issue 2026-03-03 16:47:42 +03:00
Author
Owner

@phimage commented on GitHub (Sep 12, 2018):

Please read wiki or code
If you give not give the full error...

<!-- gh-comment-id:420534520 --> @phimage commented on GitHub (Sep 12, 2018): Please read wiki or code If you give not give the full error...
Author
Owner

@Ujjwal-N commented on GitHub (Sep 12, 2018):

@phimage, Sorry about that. Here is the full error code:

The operation couldn’t be completed. (OAuthSwiftError error -11.)
2018-09-11 23:51:46.092238-0700 SkoVikes[10965:4427205] TIC Read Status [1:0x0]: 1:57
2018-09-11 23:51:46.092329-0700 SkoVikes[10965:4427205] TIC Read Status [1:0x0]: 1:57
<!-- gh-comment-id:420535581 --> @Ujjwal-N commented on GitHub (Sep 12, 2018): @phimage, Sorry about that. Here is the full error code: ``` The operation couldn’t be completed. (OAuthSwiftError error -11.) 2018-09-11 23:51:46.092238-0700 SkoVikes[10965:4427205] TIC Read Status [1:0x0]: 1:57 2018-09-11 23:51:46.092329-0700 SkoVikes[10965:4427205] TIC Read Status [1:0x0]: 1:57 ```
Author
Owner

@phimage commented on GitHub (Sep 12, 2018):

I do think that it is the full error
There is an error in requestError, see the enum definition

On Wed 12 Sep 2018 at 09:02, Ujjwal-N notifications@github.com wrote:

@phimage https://github.com/phimage, Sorry about that. Here is the full
error code:

The operation couldn’t be completed. (OAuthSwiftError error -11.)
2018-09-11 23:51:46.092238-0700 SkoVikes[10965:4427205] TIC Read Status [1:0x0]: 1:57
2018-09-11 23:51:46.092329-0700 SkoVikes[10965:4427205] TIC Read Status [1:0x0]: 1:57


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
https://github.com/OAuthSwift/OAuthSwift/issues/491#issuecomment-420535581,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AIdu-FZddVPvrOR3SeoBnvNqgQ1-iqxtks5uaLGXgaJpZM4Wkvpv
.

<!-- gh-comment-id:420536106 --> @phimage commented on GitHub (Sep 12, 2018): I do think that it is the full error There is an error in requestError, see the enum definition On Wed 12 Sep 2018 at 09:02, Ujjwal-N <notifications@github.com> wrote: > @phimage <https://github.com/phimage>, Sorry about that. Here is the full > error code: > > The operation couldn’t be completed. (OAuthSwiftError error -11.) > 2018-09-11 23:51:46.092238-0700 SkoVikes[10965:4427205] TIC Read Status [1:0x0]: 1:57 > 2018-09-11 23:51:46.092329-0700 SkoVikes[10965:4427205] TIC Read Status [1:0x0]: 1:57 > > — > You are receiving this because you were mentioned. > > > Reply to this email directly, view it on GitHub > <https://github.com/OAuthSwift/OAuthSwift/issues/491#issuecomment-420535581>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AIdu-FZddVPvrOR3SeoBnvNqgQ1-iqxtks5uaLGXgaJpZM4Wkvpv> > . >
Author
Owner

@Ujjwal-N commented on GitHub (Sep 12, 2018):

@phimage Are you referring to this file:
https://github.com/OAuthSwift/OAuthSwift/blob/master/Sources/OAuthSwiftError.swift ?

<!-- gh-comment-id:420537114 --> @Ujjwal-N commented on GitHub (Sep 12, 2018): @phimage Are you referring to this file: https://github.com/OAuthSwift/OAuthSwift/blob/master/Sources/OAuthSwiftError.swift ?
Author
Owner

@phimage commented on GitHub (Sep 12, 2018):

Yes
You can get the underlyingError or message
On Wed 12 Sep 2018 at 09:09, Ujjwal-N notifications@github.com wrote:

@phimage https://github.com/phimage Are you referring to this file:

https://github.com/OAuthSwift/OAuthSwift/blob/master/Sources/OAuthSwiftError.swift
?


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
https://github.com/OAuthSwift/OAuthSwift/issues/491#issuecomment-420537114,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AIdu-AZUQBpVPgdCzDU1k3RPoYJuspSpks5uaLMrgaJpZM4Wkvpv
.

<!-- gh-comment-id:420537470 --> @phimage commented on GitHub (Sep 12, 2018): Yes You can get the underlyingError or message On Wed 12 Sep 2018 at 09:09, Ujjwal-N <notifications@github.com> wrote: > @phimage <https://github.com/phimage> Are you referring to this file: > > https://github.com/OAuthSwift/OAuthSwift/blob/master/Sources/OAuthSwiftError.swift > ? > > — > You are receiving this because you were mentioned. > > > Reply to this email directly, view it on GitHub > <https://github.com/OAuthSwift/OAuthSwift/issues/491#issuecomment-420537114>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AIdu-AZUQBpVPgdCzDU1k3RPoYJuspSpks5uaLMrgaJpZM4Wkvpv> > . >
Author
Owner

@Ujjwal-N commented on GitHub (Sep 12, 2018):

case requestError(error: Error, request: URLRequest)
    /// Request cancelled

Why did the request get cancelled? I have no idea. @phimage. Thanks for all your help.

<!-- gh-comment-id:420539687 --> @Ujjwal-N commented on GitHub (Sep 12, 2018): ``` case requestError(error: Error, request: URLRequest) /// Request cancelled ``` Why did the request get cancelled? I have no idea. @phimage. Thanks for all your help.
Author
Owner

@phimage commented on GitHub (Sep 12, 2018):

/// Request cancelled
is the message of the Error (NSError) ie. underlyingError??

I think it is more verbose, with error code... that just a network error full of information

<!-- gh-comment-id:420553835 --> @phimage commented on GitHub (Sep 12, 2018): /// Request cancelled is the message of the Error (NSError) ie. underlyingError?? I think it is more verbose, with error code... that just a network error full of information
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#322
No description provided.