mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-26 20:55:57 +03:00
[GH-ISSUE #171] "Could not get Access Token" error when one of the values in response is not a string. #102
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#102
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 @valentinvarbanov on GitHub (Jan 14, 2016).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/171
The OAuth2Swift class interprets wrongly the response from HTTP request in method
postOAuthAccessTokenWithRequestTokenByCode("OAuth2Swift.swift") when one of the response values is not of type String. In this case on line 123 in file "OAuth2Swift.swift" the if statement returns false even that it should cast successfully the oath token, and the authentication process returns an error at the end.(I had this problem with LinkedIn OAuth2 authentication. The value of another key-value pair was with types[String: Int].)My solution is inserting another case(line 125) to try to convert non-string object to string like that:
@phimage commented on GitHub (Jan 14, 2016):
did you experiment the issue with current code? (because I have already fixed that in #159 and describe here https://github.com/OAuthSwift/OAuthSwift/releases)
watch your PR diff and see that your code will never be called, the previous if cast with same dictionary type, no more String:String