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

Handle server refreshed tokens #131

Merged
merged 1 commit into from
Jan 24, 2022
Merged

Handle server refreshed tokens #131

merged 1 commit into from
Jan 24, 2022

Conversation

davidzhao
Copy link
Member

No description provided.

@jibon57
Copy link
Contributor

jibon57 commented Jan 24, 2022

@davidzhao thank you! Won't it expose with any event back to App? For my case I'm using this token to verify other part of the application.

@davidzhao
Copy link
Member Author

@davidzhao thank you! Won't it expose with any event back to App? For my case I'm using this token to verify other part of the application.

This is not supposed to be exposed to the app itself. The idea is the ability for LiveKit clients to remain connected regardless of when the original token expires.

@davidzhao
Copy link
Member Author

@jibon57 I'm curious about your use case that would require getting the new token.

@jibon57
Copy link
Contributor

jibon57 commented Jan 24, 2022

@davidzhao in my application I'm using token to verify other request from frontend to backend. In this case I ain't using any other authentication system. If user's token is valid then other operation like update metadata (my case different permission), upload files, different moderator task etc will allow by backend server. I'm developing a complete web conference system based onlivekit which will be published as open source very soon. Hopefully within next month. I can use backend server to renew token but as you've implemented it in livekit so I wanted to use it.

@lukasIO
Copy link
Contributor

lukasIO commented Jan 24, 2022

@davidzhao Just to understand the main idea:
The updated token would only (?) be used in a reconnection attempt, right?

@davidzhao
Copy link
Member Author

@davidzhao Just to understand the main idea: The updated token would only (?) be used in a reconnection attempt, right?

yes! that's the main goal. we do not use the token for anything else. However, the refreshed token will retain all of the permissions/attributes as the original token. It simply updates the expiration field.

@davidzhao davidzhao merged commit d70e308 into main Jan 24, 2022
@davidzhao davidzhao deleted the refresh-token branch January 24, 2022 23:44
Copy link
Contributor

@lukasIO lukasIO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then everything is clear to me, LG!

Maybe we should consider firing an event with the updated token?
It would allow apps to update the token within their own state handling. And next time they connect manually they already have the updated token.

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

Successfully merging this pull request may close these issues.

5 participants