Help Center/ SparkRTC/ FAQs/ Signature/ How Does the Server Calculate the Value of signature?
Updated on 2026-05-13 GMT+08:00

How Does the Server Calculate the Value of signature?

// Hard-coded or plaintext app_key and app_id in code pose significant security risks. It is highly recommended that these credentials be stored in ciphertext within files or environment variables, and decrypted as needed to ensure security. In this example, app_key and app_id are stored in environment variables. Before running the code, set the environment variables APP_KEY and APP_ID in your local environment.
app_key =  System.getenv("APP_KEY");
app_id =  System.getenv("APP_ID");
signature = HMAC256(app_key,(app_id + room_id + user_id +ctime))