Skip to main content

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, where RtcTokenBuilder.py is used for generating an RTC token, and RtmTokenBuilder.py is used for generating an RTM token.
  • /sample/ contains the sample code for generating a token, where RtcTokenBuilderSample.py is used for generating an RTC token, and RtmTokenBuilderSample.py is 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

  1. Download or clone the Tools repository.

  2. Open the DynamicKey/AgoraDynamicKey/python/sample/RtcTokenBuilderSample.py file, replace the value of appID, appCertificate, channelName, and uid with your own, and comment out the code snippets of buildTokenWithUserAccount.

  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agoraiotools-0.3.0.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agoraiotools-0.3.0-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

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

Hashes for agoraiotools-0.3.0.tar.gz
Algorithm Hash digest
SHA256 acaa1ad5a1369a1a06e672998a09a65f547dd4dc91993e81e6f102ed148ed36c
MD5 977cfe8de0af9f1f50f0222954498207
BLAKE2b-256 ce3d99c78c96ad66c2d46662140d84d238c37c5bfecb7905404ce0f21832c126

See more details on using hashes here.

File details

Details for the file agoraiotools-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agoraiotools-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c810058b59d8887384908bf081eac06e0fe362794fb6dc0620ac75b008fdacc3
MD5 b35fcd07ed8a79da35adcba1f7d29bdb
BLAKE2b-256 b7bcb4f6853ecf22b696f914a171d4db80655082f7151eb9c71f0d0922854f59

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page