What is Token? How to generate Token? How to use Token?
This article is for reference on Native platforms only, mainly referring to iOS, Android, macOS, and Windows platforms.
What is Token
Token is an authentication token. When using the SDK, if there are high requirements for business security, you can control the permissions for "logging into a room" and "publishing streams in a room".
Before using Token for user permission control functionality, please contact ZEGOCLOUD Technical Support to configure and enable this feature.
Token Generation and Usage
After enabling the user permission control feature, the developer's server generates a Token. When users log into a room, they pass in the Token and set the corresponding permissions. Through the SDK's transmission, the ZEGO server will verify users with Token. Based on the Token parameters, it determines whether the user can log into a specific room and publish streams in the room.
For specific implementation, please refer to Video Call - User Permission Control.
Token Validity Period
The validity period of Token is set by the developer. For specific implementation, please refer to Video Call - User Permission Control in the "Generate Token" section.
SDK Behavior When Token Expires and Recommended Handling Method
When Token expires, users will not be immediately kicked out of the room, and the currently successfully published streams will not be affected, but it will affect the user's next login and publishing operations. Developers need to obtain a new valid Token from their own server and call the renewToken interface provided by the SDK to update the Token.
API Reference:
- iOS: renewToken
- Android: renewToken
- macOS: renewToken
- Windows: renewToken
