🔑 Guest Issuer Token creation and individual user anonymous access - ponchotitlan/webex_web_calling_client GitHub Wiki

In order to generate a Guest Issuer App integration, complete the following steps:

  1. Login to the Webex Developer Portal
  2. Select the Start Building Apps button.
  3. Click on the Create New App Button.
  4. Select Create a Guest Issuer option.
  5. Enter a guest issuer name. Note: This name will be used to create a display name for the user when joining calls.
  6. Take note of the Guest Issuer App Credentials. This credential will be required to generate the authentication token for the Webex Integration

In order to use the credentials in the Web dialer, open the environment data file .env located in the repo, and input your information:

ISSUER_ID = <your issuer ID. See this repo's Wiki for more information>
SHARED_SECRET = <your shared secret. See this repo's Wiki for more information>

This .env file must be located in the same directory as your package.json file.

The web dialer creates a valid guest issuer token for authentication which is unique for each user. This ensures that users appear as individual people in Webex Teams and Webex Meetings. The tokens are created using the JWT library. The fields for **sub **and **name **are populated with the string "Client-". This will be their display name when in the call. The tokens have a life span of one hour.

function jwtGeneration(){
  var random_name = "Client-"+Math.random().toString(36).substr(2, 10);
  console.log(random_name);
  var oHeader = {alg: 'HS256', typ: 'JWT'};
  var oPayload = {};
  var tNow = KJUR.jws.IntDate.get('now');
  var tEnd = KJUR.jws.IntDate.get('now + 1hour');
  oPayload.iss = issuer_id;
  oPayload.sub = random_name;
  oPayload.name = random_name;
  oPayload.nbf = tNow;
  oPayload.iat = tNow;
  oPayload.exp = tEnd;
  var sHeader = JSON.stringify(oHeader);
  var sPayload = JSON.stringify(oPayload);
  return KJUR.jws.JWS.sign("HS256", sHeader, sPayload, {b64u: shared_secret});
}