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

Session terminating after accessToken expires #43

Closed
lukaarma opened this issue Apr 7, 2020 · 6 comments
Closed

Session terminating after accessToken expires #43

lukaarma opened this issue Apr 7, 2020 · 6 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@lukaarma
Copy link
Collaborator

lukaarma commented Apr 7, 2020

Right now to make the execution a bit less annoying the login happens only at the beginning and if too much time the token expires, so if the queue is too long it may stop working mid download.

To fix this we can check before every download how much time remains before the token expires, I don't have the time right now.

@lukaarma lukaarma added bug Something isn't working enhancement New feature or request labels Apr 7, 2020
@snobu
Copy link
Owner

snobu commented Apr 10, 2020

/refreshtoken may hold the answer here. We could exchange our access token for a fresh token by calling that endpoint at the start of the next video download (array position 1, since 0 already has our cached access token).

Did a little experiment and it works, i'll push an implementation soon.

@snobu
Copy link
Owner

snobu commented Apr 11, 2020

curl 'https://euwe-1.api.microsoftstream.com/api/refreshtoken?api-version=1.3-private'  \
    -H 'Authorization: Bearer eyJ0eXAi....Rpxg' 

< set-cookie: Authorization=eyJUb2tl....

Nothing to see here, just a note to myself.

@snobu
Copy link
Owner

snobu commented Apr 12, 2020

Partial implementation via #62

@snobu snobu added this to the v2.0 milestone Apr 12, 2020
@snobu snobu removed the bug Something isn't working label Apr 12, 2020
@el3ctrician
Copy link

i started to work on this but on an older version... how can i help to get the implementation from partial to full ?

Thanks

@snobu
Copy link
Owner

snobu commented Apr 19, 2020

It's fully implemented in the master branch with one caveat. See Found a bug section in README.

@snobu
Copy link
Owner

snobu commented Apr 21, 2020

Closing as completed. We'll open a new issue for the remaining problem of refreshing tokens on a separate execution thread.

@snobu snobu closed this as completed Apr 21, 2020
Destreamer 2.0 (tokencache will become master) automation moved this from In progress to Done Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Development

No branches or pull requests

3 participants