Comments (5)
unlike jwt token. you cannot parse a token back to readable information. is there any reason you want to do that?
from tools.
Yes, I want to write a test similar I showed in the description. I want to call a method with my parameters and this method returns a token. After that I want to check if in this token are my passed parameters, like uid
, role
, channelName
, etc.
from tools.
@nilsreichardt unfortunately you can't do that. we compare your token by generating a token using same algorithm and parameters and compare them. we don't convert it back to raw info either. As long as you are using our original algorithm and correct parameter, the token generated should be correct.
from tools.
@nilsreichardt I haven't verified this when running, but looking at the source..
We can see the source for buildTokenWithAccount
here:
Tools/DynamicKey/AgoraDynamicKey/nodejs/src/RtcTokenBuilder.js
Lines 60 to 71 in a27ccdd
It uses AccessToken
, which is defined at:
You can see the build
function within this, that returns version + token.appID + content.toString('base64')
:
Tools/DynamicKey/AgoraDynamicKey/nodejs/src/AccessToken.js
Lines 23 to 46 in a27ccdd
There is also the fromString
function defined in that same file:
Tools/DynamicKey/AgoraDynamicKey/nodejs/src/AccessToken.js
Lines 52 to 79 in a27ccdd
Based on that, it looks like you should be able to recover some, if not most/all of the parameters you want, and thus be able to write some tests for them.
Let me know how you go with this, would be interested to hear!
from tools.
@plutoless is there documentation or can you clarify the details on the tokenbuilder. I am specifically looking for the difference between the below two methods. C# example..
What is this property does this._salt = salt;?
public AccessToken(string appId, string appCertificate, string channelName, string uid)
{
_appId = appId;
_appCertificate = appCertificate;
_channelName = channelName;
_uid = uid;
}
public AccessToken(string appId, string appCertificate, string channelName, string uid, uint ts, uint salt)
{
this._appId = appId;
this._appCertificate = appCertificate;
this._channelName = channelName;
this._uid = uid;
this._ts = ts;
this._salt = salt;
}
from tools.
Related Issues (20)
- 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 1
- agora-token: Buffer is not defined HOT 1
- java sdk maven**仓库没有更新 HOT 1
- 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
- 如何renewToken HOT 1
- AGORA TOKEN GENERATION ISSUES HOT 1
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.