Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing 'expires_in' on Token #49

Closed
tusaamf opened this issue Oct 27, 2020 · 7 comments
Closed

Missing 'expires_in' on Token #49

tusaamf opened this issue Oct 27, 2020 · 7 comments

Comments

@tusaamf
Copy link

tusaamf commented Oct 27, 2020

Missing parameter 'expires_in' on Token

{
"token_type": "Bearer",
"expires_at": 1568775134,
"expires_in": 21600,
"refresh_token": "e5n567567...",
"access_token": "a4b945687g...",
"athlete": {
#{summary athlete representation}
}
}

@BirdyF
Copy link
Collaborator

BirdyF commented Nov 8, 2020

Hi @tunt-04098

Thanks to spot it.
I will add it in the next version.

@MrCsabaToth
Copy link
Contributor

Where is this code section?

@MrCsabaToth
Copy link
Contributor

Note that this image https://developers.strava.com/images/authentication-2.png of the https://developers.strava.com/docs/authentication/ does not mention to store the expires_in explicitly. Maybe it's an oversight, but if you think about it the expires_at is a well defined specific time, whereas the expires_in only makes sense at the time of receiving that from the Strava back-end. If you later would send that to the Strava back-end then it would be imprecise, you'd need to offset that with the current time of sending vs the receiving time of the response...

@BirdyF
Copy link
Collaborator

BirdyF commented Nov 15, 2020

Hi @MrCsabaToth
Thanks for the clarification. I agree with you.
expires_at can be stored while expires_in can be used directly by the app.
Anyway could be worth to add it as a parameter in case some people want to use it.

@MrCsabaToth
Copy link
Contributor

Just a note since I'm working on SUUNTO, MapMyFitness and other OAuth authentications: some OAuth servers only supply expires_in and some only expires_at. If the code expects only the other then there would be an error. I convert expires_in to expires_at on my back-end. If Strava doesn't give me expires_in then it probably doesn't expect it to get it and it expects the same coming back.

@dreampowder
Copy link
Owner

Hi @MrCsabaToth , i closed this issue because i am completely refactong the code and i think we should let developers to decide what to do with expires_in property.

So i decided to store this value too for future sessins.

thanks again for all your efforts, i am always looking forward for your valuable contributions

@MrCsabaToth
Copy link
Contributor

Hi @dreampowder I saw there was a lot of refactoring done. Thanks for your work, I just added my comments for the record. Hopefully in the future I can contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants