diff --git a/shared/video-sdk/authentication-workflow/index.mdx b/shared/video-sdk/authentication-workflow/index.mdx index e26cef2ee..f160df441 100644 --- a/shared/video-sdk/authentication-workflow/index.mdx +++ b/shared/video-sdk/authentication-workflow/index.mdx @@ -839,7 +839,7 @@ Refer to the following steps to build and run a token generator locally to gener 1. Run the following command to install dependencies. ```go - $ go get + $ go get github.com/AgoraIO/Tools/DynamicKey/AgoraDynamicKey/go/src/rtctokenbuilder2 ``` 1. Run the following command to start the token generator: @@ -869,13 +869,13 @@ SDKs using `AccessToken2` can interoperate with SDKs using `AccessToken`. The SD ### API Reference​ -This section documents the core methods you use to generate tokens, using the Golang language as an example. +This section documents the core methods you use to generate tokens, using the Golang code as an example. -- `BuildTokenWithUid`: Generate a token, set the expiration time, and define all permissions. -- `BuildTokenWithUidAndPrivilege`: Generate a token with fine control over streaming permissions. Set the validity period of the token and the expiration time of permissions to join channels, publish audio, video, and data streams. -To generate a token and set the expiration time for all permissions, use: +#### `BuildTokenWithUid` + +Generate a token, set the expiration time, and define all permissions. ```go func BuildTokenWithUid( @@ -902,7 +902,9 @@ func BuildTokenWithUid( If the token expires but the permissions have not expired, the user remains in the channel and can continue to send streams. Any callbacks related to the token in the SDK are not triggered. Once disconnected from the channel, the user is not able to use the expired token to join the same channel. Best practice is to use consistent settings for the token expiration time and the permission expiration time. -To generate a token and set expiration time for different permissions, use: +#### `BuildTokenWithUidAndPrivilege` + +Generate a token with fine control over streaming permissions. Set the validity period of the token and the expiration time of permissions to join channels, publish audio, video, and data streams. ```go func BuildTokenWithUidAndPrivilege( diff --git a/shared/video-sdk/authentication-workflow/project-implementation/web.mdx b/shared/video-sdk/authentication-workflow/project-implementation/web.mdx index 4e2e3e51d..6f768bf3b 100644 --- a/shared/video-sdk/authentication-workflow/project-implementation/web.mdx +++ b/shared/video-sdk/authentication-workflow/project-implementation/web.mdx @@ -23,7 +23,71 @@ This section shows you how to integrate token authentication in your Sample code for basic authentication @@ -117,7 +181,7 @@ This section shows you how to integrate token authentication in your performs the following operations: * Obtains a token from your token server. * Joins the channel. -* Automatically renews the token when it is about to expire. +* Automatically renews the token when it is about to expire. \ No newline at end of file