mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-26 12:45:52 +03:00
[GH-ISSUE #413] Error with Lyft oAuth2 - Invalid client #264
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#264
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 @sanchexx on GitHub (Sep 30, 2017).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/413
Description:
I'm trying to implement Lyft API but keep getting Invalid client errors.
I've found people were having similar issues with Uber #59 . Tried their solution but no luck. I still suspect it have something to do with encoding.
Attached snippets of code and error below
OAuth Provider (Twitter, Github, ..):
Lyft
https://developer.lyft.com/v1/docs/authentication
OAuth Version:
OS (Please fill the version) :
Installation method:
Library version:
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
Tried both with the block in comment and the one below it
`
var oauthswift:OAuth2Swift!
`
It seem that before even getting the request error, there is an Error copying creds
`
2017-09-30 18:04:13.197537-0400 Wellness Prototype[17594:13646546] CredStore - performQuery - Error copying matching creds. Error=-25300, query={
class = inet;
"m_Limit" = "m_LimitAll";
ptcl = htps;
"r_Attributes" = 1;
sdmn = "lyft-public-api";
srvr = "api.lyft.com";
sync = syna;
}
["request": https://api.lyft.com/oauth/token, "error": Error Domain=NSURLErrorDomain Code=401 "invalid_client Unauthorized" UserInfo={Response-Body={
"error_description": "Unauthorized",
"error": "invalid_client"
}
, NSErrorFailingURLKey=https://api.lyft.com/oauth/token, Response-Headers={
"Cache-Control" = "no-store";
"Content-Length" = 72;
"Content-Type" = "application/json;charset=UTF-8";
Date = "Sat, 30 Sep 2017 22:04:13 GMT";
Pragma = "no-cache";
Server = "envoy-iad";
"Www-Authenticate" = "Basic realm="lyft-public-api"";
"request-id" = "d8bd8080-7086-90c8-82df-fabf19523d68";
"x-envoy-upstream-service-time" = 2;
}, OAuthSwiftError.response=<NSHTTPURLResponse: 0x60c0002204c0> { URL: https://api.lyft.com/oauth/token } { status code: 401, headers {
"Cache-Control" = "no-store";
"Content-Length" = 72;
"Content-Type" = "application/json;charset=UTF-8";
Date = "Sat, 30 Sep 2017 22:04:13 GMT";
Pragma = "no-cache";
Server = "envoy-iad";
"Www-Authenticate" = "Basic realm="lyft-public-api"";
"request-id" = "d8bd8080-7086-90c8-82df-fabf19523d68";
"x-envoy-upstream-service-time" = 2;
} }, OAuthSwiftError.response.data=<7b0a2020 22657272 6f725f64 65736372 69707469 6f6e223a 2022556e 61757468 6f72697a 6564222c 200a2020 22657272 6f72223a 2022696e 76616c69 645f636c 69656e74 220a7d0a>, NSLocalizedDescription=invalid_client Unauthorized}]
The operation couldn’t be completed. (OAuthSwiftError error -11.)2017-09-30 18:04:13.273343-0400
`
@sanchexx commented on GitHub (Sep 30, 2017):
Testing on iOS 10.3 instead of iOS 11, I don't get the first error 'Error copying matching creds'
The invalid client problem still happens though
@phimage commented on GitHub (Oct 1, 2017):
I cannot create account, I think with my french phone number
So I can't test and help...
I fix the demo apps for swift4 and put a code for lyft (but not activated yet)
@phimage commented on GitHub (Oct 1, 2017):
@sanchexx try to set oauthswift.accessTokenBasicAuthentification to true
I see basic auth in doc
@sanchexx commented on GitHub (Oct 1, 2017):
@phimage Thanks! Adding the Basic Authentification solved the issue.