mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-28 13:45:49 +03:00
[GH-ISSUE #566] The operation couldn’t be completed. (OAuthSwiftError error -11.) #370
Labels
No labels
bug
cocoapod
duplicate
enhancement
feature-request
help wanted
help wanted
invalid
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/OAuthSwift#370
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dipendrapulse on GitHub (Dec 17, 2019).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/566
Description:
OAuth Provider? (Basecamp3):
OAuth Version:
OS (Please fill the version) :
Installation method:
Library version:
Xcode version:
11.x (Swift 5.1)
[ x] 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
I am trying to integrate basecamp3 but getting the error.
@phimage commented on GitHub (Dec 17, 2019):
https://github.com/OAuthSwift/OAuthSwift/blob/master/Sources/OAuthSwiftError.swift#L59
use debuger and see in error not only the localizedDescription but the cause error, an URLError I think and you will now
@dipendrapulse commented on GitHub (Dec 17, 2019):
It shows request error but i am not able to understand this. Please correct me if I am doing something wrong
When i print the 'result' then it shows
expression produced error: error: /var/folders/lz/8g6p_v417qvf4419d1ktm3mm0000gn/T/expr33-88f131..swift:1:89: error: 'OAuthSwift' is not a member type of 'OAuthSwift'
@phimage commented on GitHub (Dec 18, 2019):
print? it is not debugger like I say...
or "switch" on the error enum
@dipendrapulse commented on GitHub (Dec 18, 2019):
I think you are asking this
Result<(credential: OAuthSwiftCredential, response: Optional, parameters: Dictionary<String, Any>), OAuthSwiftError>
▿ failure : requestError[Error Domain=OAuthSwiftError Code=400 "Unsupported type. Expected "web_server" or "refresh"." UserInfo={NSLocalizedDescription=Unsupported type. Expected "web_server" or "refresh"., Response-Body={"error":"Unsupported type. Expected "web_server" or "refresh"."}, Response-Headers={
"Cache-Control" = "no-cache";
Connection = "keep-alive";
"Content-Type" = "application/json; charset=utf-8";
Date = "Wed, 18 Dec 2019 16:34:22 GMT";
"Referrer-Policy" = "strict-origin-when-cross-origin";
Server = openresty;
Status = "400 Bad Request";
"Strict-Transport-Security" = "max-age=31536000; includeSubDomains; preload";
"Transfer-Encoding" = Identity;
"X-Content-Type-Options" = nosniff;
"X-Download-Options" = noopen;
"X-Frame-Options" = SAMEORIGIN;
"X-Permitted-Cross-Domain-Policies" = none;
"X-Request-Id" = "fc071da0-319e-472a-aaaf-3ca90f909e63";
"X-Robots-Tag" = noindex;
"X-Runtime" = "0.002775";
"X-XSS-Protection" = "1; mode=block";
}, OAuthSwiftError.response=<NSHTTPURLResponse: 0x283860340> { URL: https://launchpad.37signals.com/authorization/token } { Status Code: 400, Headers {
"Cache-Control" = (
"no-cache"
);
Connection = (
"keep-alive"
);
"Content-Type" = (
"application/json; charset=utf-8"
);
Date = (
"Wed, 18 Dec 2019 16:34:22 GMT"
);
"Referrer-Policy" = (
"strict-origin-when-cross-origin"
);
Server = (
openresty
);
Status = (
"400 Bad Request"
);
"Strict-Transport-Security" = (
"max-age=31536000; includeSubDomains; preload"
);
"Transfer-Encoding" = (
Identity
);
"X-Content-Type-Options" = (
nosniff
);
"X-Download-Options" = (
noopen
);
"X-Frame-Options" = (
SAMEORIGIN
);
"X-Permitted-Cross-Domain-Policies" = (
none
);
"X-Request-Id" = (
"fc071da0-319e-472a-aaaf-3ca90f909e63"
);
"X-Robots-Tag" = (
noindex
);
"X-Runtime" = (
"0.002775"
);
"X-XSS-Protection" = (
"1; mode=block"
);
} }, OAuthSwiftError.response.data=<7b226572 726f7222 3a22556e 73757070 6f727465 64207479 70652e20 45787065 63746564 205c2277 65625f73 65727665 725c2220 6f72205c 22726566 72657368 5c222e22 7d>, NSErrorFailingURLKey=https://launchpad.37signals.com/authorization/token}]
▿ requestError : 2 elements
- error : Error Domain=OAuthSwiftError Code=400 "Unsupported type. Expected "web_server" or "refresh"." UserInfo={NSLocalizedDescription=Unsupported type. Expected "web_server" or "refresh"., Response-Body={"error":"Unsupported type. Expected "web_server" or "refresh"."}, Response-Headers={
"Cache-Control" = "no-cache";
Connection = "keep-alive";
"Content-Type" = "application/json; charset=utf-8";
Date = "Wed, 18 Dec 2019 16:34:22 GMT";
"Referrer-Policy" = "strict-origin-when-cross-origin";
Server = openresty;
Status = "400 Bad Request";
"Strict-Transport-Security" = "max-age=31536000; includeSubDomains; preload";
"Transfer-Encoding" = Identity;
"X-Content-Type-Options" = nosniff;
"X-Download-Options" = noopen;
"X-Frame-Options" = SAMEORIGIN;
"X-Permitted-Cross-Domain-Policies" = none;
"X-Request-Id" = "fc071da0-319e-472a-aaaf-3ca90f909e63";
"X-Robots-Tag" = noindex;
"X-Runtime" = "0.002775";
"X-XSS-Protection" = "1; mode=block";
}, OAuthSwiftError.response=<NSHTTPURLResponse: 0x283860340> { URL: https://launchpad.37signals.com/authorization/token } { Status Code: 400, Headers {
"Cache-Control" = (
"no-cache"
);
Connection = (
"keep-alive"
);
"Content-Type" = (
"application/json; charset=utf-8"
);
Date = (
"Wed, 18 Dec 2019 16:34:22 GMT"
);
"Referrer-Policy" = (
"strict-origin-when-cross-origin"
);
Server = (
openresty
);
Status = (
"400 Bad Request"
);
"Strict-Transport-Security" = (
"max-age=31536000; includeSubDomains; preload"
);
"Transfer-Encoding" = (
Identity
);
"X-Content-Type-Options" = (
nosniff
);
"X-Download-Options" = (
noopen
);
"X-Frame-Options" = (
SAMEORIGIN
);
"X-Permitted-Cross-Domain-Policies" = (
none
);
"X-Request-Id" = (
"fc071da0-319e-472a-aaaf-3ca90f909e63"
);
"X-Robots-Tag" = (
noindex
);
"X-Runtime" = (
"0.002775"
);
"X-XSS-Protection" = (
"1; mode=block"
);
} }, OAuthSwiftError.response.data=<7b226572 726f7222 3a22556e 73757070 6f727465 64207479 70652e20 45787065 63746564 205c2277 65625f73 65727665 725c2220 6f72205c 22726566 72657368 5c222e22 7d>, NSErrorFailingURLKey=https://launchpad.37signals.com/authorization/token}
▿ request : https://launchpad.37signals.com/authorization/token
▿ url : Optional
▿ some : https://launchpad.37signals.com/authorization/token
- _url : https://launchpad.37signals.com/authorization/token
- cachePolicy : 0
- timeoutInterval : 60.0
- mainDocumentURL : nil
- networkServiceType : __C.NSURLRequestNetworkServiceType
- allowsCellularAccess : true
▿ httpMethod : Optional
- some : "POST"
▿ allHTTPHeaderFields : Optional<Dictionary<String, String>>
▿ some : 1 element
▿ 0 : 2 elements
- key : "Content-Type"
- value : "application/x-www-form-urlencoded; charset=utf-8"
▿ httpBody : Optional
▿ some : 255 bytes
- count : 255
▿ pointer : 0x0000000133d196e0
- pointerValue : 5164340960
- httpBodyStream : nil
- httpShouldHandleCookies : false
- httpShouldUsePipelining : false
@dipendrapulse commented on GitHub (Dec 18, 2019):
I got the error, i changed my tokenurl to "https://launchpad.37signals.com/authorization/token?type=web_server" & it seems to be working now.