mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-27 05:05:51 +03:00
[GH-ISSUE #422] Fitbit expired token not handled #271
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#271
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 @hardikdevios on GitHub (Dec 14, 2017).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/422
Description:
Fitbit expired token not handled
i have to add this in order to parse that properly
https://dev.fitbit.com/reference/web-api/oauth2/#refresh-token-errors
OAuth Provider (Twitter, Github, ..):
FitBit
OAuth Version:
OS (Please fill the version) :
Installation method:
Library version:
Xcode version:
@phimage commented on GitHub (Dec 14, 2017):
Could you provide the entire content of header in this case? (you can remove token value etc...)
Maybe there is other interesting http headers . (
headerDictionary["errors"]?)@hardikdevios commented on GitHub (Dec 14, 2017):
As you can see parsing is failing here for
Www-Authenticatebecause the data which we are looking for invalid-token is not inheaderDictionaryits actually inResponse-Body, so you can handle it properly i just have changed for my quick fix but there is always a room for improvement@phimage commented on GitHub (Dec 14, 2017):
Yes that's why I ask :)
Like Facebook special case, we could parse here "Response-Body" and check here errorType == "invalid_token"
We could limit to fitbit like you do with
headerDictionary["Bearer realm"], error == "\"api.fitbit.com\"", to limit potential issuesYou could do a PR if you want
@hardikdevios commented on GitHub (Dec 14, 2017):
Sure will do that on weekend, No time now ;)
@phimage commented on GitHub (Mar 4, 2018):
No PR so I make a branch fix/fitbiterror
with the modified version of NSError extension
https://github.com/OAuthSwift/OAuthSwift/blob/fix/fitbiterror/Sources/NSError%2BOAuthSwift.swift
So @hardikdevios you can test it
@phimage commented on GitHub (Jun 25, 2018):
I merge branch
4a95cd7ab7