Agora token generation utilities
Project description
Authenticate Users with a token
To enhance communication security, Agora uses tokens to authenticate users before they access the Agora service, or joining an RTC channel.
Code structure
Under the python3 directory:
/src/contains the source code for generating a token, whereRtcTokenBuilder.pyis used for generating an RTC token, andRtmTokenBuilder.pyis used for generating an RTM token./sample/contains the sample code for generating a token, whereRtcTokenBuilderSample.pyis used for generating an RTC token, andRtmTokenBuilderSample.pyis used for generating an RTM token.
Generate a token with the sample code
This section takes RtcTokenBuilderSample.py as an example to show how to generate a token with the sample code.
Before proceeding, ensure that you have Python 3 as the development environment. Use the following command to check your current Python version:
Python -V
-
Download or clone the Tools repository.
-
Open the
DynamicKey/AgoraDynamicKey/python/sample/RtcTokenBuilderSample.pyfile, replace the value ofappID,appCertificate,channelName, anduidwith your own, and comment out the code snippets ofbuildTokenWithUserAccount. -
Open your Terminal, navigate to the same directory that holds
RtcTokenBuilderSample.py, and run the following command. The token is generated and printed in your Terminal window:python RtcTokenBuilderSample.py
Reference
For a complete authentication flow between the app server and app client, see Authenticate Your Users with Tokens.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agoraiotools-0.3.0.tar.gz.
File metadata
- Download URL: agoraiotools-0.3.0.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
acaa1ad5a1369a1a06e672998a09a65f547dd4dc91993e81e6f102ed148ed36c
|
|
| MD5 |
977cfe8de0af9f1f50f0222954498207
|
|
| BLAKE2b-256 |
ce3d99c78c96ad66c2d46662140d84d238c37c5bfecb7905404ce0f21832c126
|
File details
Details for the file agoraiotools-0.3.0-py3-none-any.whl.
File metadata
- Download URL: agoraiotools-0.3.0-py3-none-any.whl
- Upload date:
- Size: 19.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c810058b59d8887384908bf081eac06e0fe362794fb6dc0620ac75b008fdacc3
|
|
| MD5 |
b35fcd07ed8a79da35adcba1f7d29bdb
|
|
| BLAKE2b-256 |
b7bcb4f6853ecf22b696f914a171d4db80655082f7151eb9c71f0d0922854f59
|