Skip to content

Releases: AgoraIO-Community/agora-token-service

v1.5

16 May 20:32
98f5620
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.4.4...v1.5

v1.4.4

11 Dec 11:01
442828f
Compare
Choose a tag to compare

Re-added ping/pong health check.

v1.4.3

21 Aug 08:27
a04f110
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.4.2...v1.4.3

v1.4.3-rc.2

16 Aug 10:58
b3298cc
Compare
Choose a tag to compare

Make more functions available through imports

v1.4.2

08 Aug 07:53
325ec9e
Compare
Choose a tag to compare

Added CORS control, this helps determine which origins are permitted to access the resources of your application.

v1.4.1

26 Jul 15:31
b0d693d
Compare
Choose a tag to compare

Changes Made

  • Added a new function "getToken" to the Service struct to handle the "getToken" endpoint (POST requests).
  • Implemented logic to parse the request body into a TokenRequest struct to process token generation requests.
  • Implemented functions to generate RTC tokens, RTM tokens, and chat tokens based on the TokenRequest.
  • updated to go-tokenbuilder 1.3.0, which gives streamtokens with rtm if channel name is provided.

New Endpoint Details

Endpoint: /getToken

HTTP Method: POST

Request Payload:

{
  "tokenType": "rtc",       // The token type: "rtc", "rtm", or "chat"
  "channel": "channel123",  // The channel name (used for RTC and RTM tokens)
  "role": "publisher",      // The role of the user for RTC tokens (publisher or subscriber)
  "uid": "123",         // The user ID or account (used for RTC, RTM, and some chat tokens)
  "expire": 3600            // The token expiration time in seconds (used for all token types)
}

Response

Upon successful generation of the token, the API will respond with an HTTP status code of 200 OK, and the response body will contain the token in a JSON key "token".

{
  "token": "007hbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhZG1pbiIsInN1YiI6InVzZXIxMjMiLCJpYXQiOjE2MzEwNTU4NzIsImV4cCI6MTYzMTA1OTQ3Mn0.3eJ-RGwIl2ANFbdv4SeHtWzGiv6PpC3i0UqXlHfsqEw"
}

If there are validation errors in the request or issues during token generation, the endpoint responds with an appropriate error message and the corresponding status code.


#38

Full Changelog: v1.4.0...v1.4.1

v1.4.0

11 Jul 15:34
bbd3abc
Compare
Choose a tag to compare

To use chat tokens:

endpoint structure

  • app privileges: chat/app/?expiry=3600
  • user privileges: /chat/account/:chatid/?expiry=3600

expiry is an optional parameter for both.

response:

{
  "chatToken":"007chat-token-djfkaljdla"
} 

v1.3.0

27 Jun 07:33
4966aa0
Compare
Choose a tag to compare

Tokens now compatible with Signaling (RTM 2)

Tokens are backwards compatible.

1.2.1

24 Jan 11:56
10107c2
Compare
Choose a tag to compare

Fix issue with RTC tokens when RTM ID is not passed.

1.2.0

27 Oct 11:04
Compare
Choose a tag to compare
  • Separate /service file structure. This means a different way to execute.
  • Dockerfile updated to work with Railway.app
  • Badges updated
  • Fix having different RTC and RTM tokens