Documentation
Agora Basics
Token Migration Guide
Token Migration Guide
Last updated 2022/02/23 03:02:32
This page describes how to migrate from the legacy Dynamic Key to a Token.
1. Client API Change Log
Android API Change Log
v2.0.2 |
v2.1.0 |
public int joinChannel(String channelKey, String channelName, String optionalInfo, int optionalUid); |
public int joinChannel(String token, String channelName, String optionalInfo, int optionalUid); |
public int setClientRole(int role, String permissionKey) |
int setClientRole(int role) |
public void onRequestChannelKey(); |
public void onRequestToken(); |
public int renewChannelKey(const char* channelKey) |
public int renewtoken( const char* token) |
iOS API Change Log
v2.0.2 |
v2.1.0 |
joinChannelByKey:channelName:info:uid:joinSuccess: |
joinChannelByToken:channelId:info:uid:joinSuccess: |
setClientRole:withKey: |
setClientRole: |
rtcEngineRequestChannelKey: |
rtcEngineRequestToken: |
renewChannelKey: |
renewToken: |
macOS API Change Log
v2.0.2 |
v2.1.0 |
joinChannelByKey:channelName:info:uid:joinSuccess: |
joinChannelByToken:channelId:info:uid:joinSuccess: |
setClientRole:withKey: |
setClientRole: |
rtcEngineRequestChannelKey: |
rtcEngineRequestToken: |
renewChannelKey: |
renewToken: |
Windows API Change Log
v2.0.2 |
v2.1.0 |
public int joinChannel(const char* channelKey, const char* channel, const char* info, uid_t uid) |
public int joinChannel(String token, String channelName, String optionalInfo, int optionalUid); |
public int setClientRole(CLIENT_ROLE_TYPE role, const char* permissionKey); |
int setClientRole(int role) |
public virtual void onRequestChannelKey(); |
public void onRequestToken(); |
public int renewChannelKey(const char* channelKey) |
public int renewtoken( const char* token) |
Web API Change Log
v2.3.1 |
v2.4.0 |
client.join(channelKey, channel, uid, onSuccess, onFailure) |
client.join(token, channel, uid, onSuccess, onFailure) |
client.renewChannelKey |
client.renewToken |
2. Dynamic Key Generation Parameters (2.0.2) versus Token Generation Parameters (2.1)
The following table compares the parameters used for generating a dynamic key with those used for generating a Token:
Dynamic Key |
Token |
Description |
App ID |
App ID |
|
App Certificate |
App Certificate |
|
channelName |
channelName |
|
unixTs/Ts |
N/A |
Removes the time stamp parameter. |
uid |
uid |
|
expiredTs/timeputFromNow |
expiredTs/timeputFromNow |
Keeps the service timeout parameter. |
randomint/r |
randomint/r |
|
N/A |
Role |
Adds the roles and the privileges related to the roles. See Role-privilege Model. |