Help Center/ Meeting/ Client SDK Reference/ Web SDK/ Typical Scenarios/ Scenario 2: Joining a Meeting After Authentication
Updated on 2025-04-18 GMT+08:00

Scenario 2: Joining a Meeting After Authentication

Description

If you want to join a meeting after login, perform app ID authentication to obtain a token, call the joinConf API of the SDK, and listen to the join_conf_result event.

  • Joining a meeting after authentication: Log in to the system and then join a meeting.
  • Joining a meeting anonymously: Join a meeting without authentication.
  • The token field in the joinConf API is optional. If the token field is not carried, you will join the meeting anonymously.

Service Process

  1. Call an API.

    1. Obtain an access token based on the app ID and key.

      - For details about app ID authentication, see Introduction to App ID Authentication in Developer Guide.

      - For details about the REST API for obtaining an access token, see Authenticating an App ID.

    2. Use the obtained access token as the input parameter of the joinConf API of the SDK. (The parameter name is token.)

      You can obtain the access token only by calling the REST API in the backend. If you call the REST API in the browser foreground, a CORS error will occur.

  2. Implement the callback function.

    Implement the join_conf_result function.

Sample Code

1
2
3
4
5
6
7
HWMeeting.joinConf({confId, pwd, nickName, token}).then(() => {
    // API called.
    ...    
   }).catch((e) => {
    // API calling failed.
    ...    
})

The sample code in the typical scenario and API reference is pseudo code and cannot be directly used.