Comments (6)
if you specify uid when you calculate a token. the token can only be used by corresponding user.
if you want to provide a token which works for any user joining this channel, provide uid 0 when calculating a token - although this is causing some security concerns.
from tools.
i think you can leave 24 * 3600 as it is. A token will be invalid after 24 hours by default. In most cases you don't need to care about this parameter.
if you want to set 30 minutes for expiredTs, set it to currentTimeStamp + 30 * 60
from tools.
@georgemichailou could you pls try using the access token version? as dynamic key4 is a bit out dated.
from tools.
Thanks @plutoless , the access token is working perfect !!
Can i ask you something ?
I cant understand the values for _ts and _expiredTs.
[1]: The timestamp, represented by the number of seconds elapsed since 1/1/1970. The user can use the Dynamic Key to access the Agora service within 5 minutes after the Dynamic Key is generated. If the user does not access the Agora service after 5 minutes, the Dynamic Key is no longer valid.
[2]: Set the value to 0 for no time limit. Indicates the exact time when a user can no longer use the Agora service (for example, when a user is forced to leave an ongoing call). When the value is set for Call Expiration Timestamp, it does not mean that the Dynamic Key will be expired, but means that the user will be kicked out of the channel.
For the _ts the default value is
uint _ts = (uint)(Utils.Utils.getTimestamp() + 24 * 3600);
What is the 24 * 3600 ?
For the _expiredTs if i want to set 30 minutes expiration what can i do ? The 0 value is for no time limit.
This one is not a good practise ?
uint _ts = (uint)(Utils.Utils.getTimestamp()); // the number of seconds elapsed since 1/1/1970
uint _expiredTs = (uint)(Utils.Utils.getTimestamp() + 30*60); //30 minutes expiration
Thanks.
from tools.
One more question @plutoless . If I want to create an one to one communication. Can i use the same token on both sides or i will create the new one on every user ? (with same channel id)
from tools.
if you are manually testing this scenario then you must add the same uid at the client-side while joining the room which is there while generating the token.
from tools.
Related Issues (20)
- Is it mandatory to login RTC while fetching Video/Audio in Android App? HOT 1
- Need help for token generation for user registration through rest api HOT 1
- RTC token not valid HOT 3
- issue with RTC token on the web HOT 10
- Which package should I use? when it cames to agora-access-token and agora-token. HOT 3
- [ruby] warning message of dynamic_key5.rb in Ruby 3.2 HOT 3
- feat: Support for ESM HOT 2
- agora-token: Buffer is not defined HOT 1
- java sdk maven**仓库没有更新 HOT 2
- Why c# code is using _uid as _channelName RTM Token generation c# HOT 2
- crypto.createHmac is not a function TypeError: crypto.createHmac is not a function HOT 1
- index.htmlpackage-ecosystem
- 能不能把不同语言的sdk分开,以便使用安装 HOT 3
- Problem in Building AccessToken2 || which library I have to use HOT 1
- Add API for synchronous token validation HOT 1
- python3和python2 下生成的Education Token是否可用? HOT 2
- AgoraRTCError CAN_NOT_GET_GATEWAY_SERVER with PHP 8.2 HOT 1
- go RtcTokenBuilder vs rtctokenbuilder2 HOT 1
- getStats() method is no longer supported HOT 2
- Error: error:0308010C:digital envelope routines::unsupported HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tools.