Override development key generation

Prerequisite: This topic assumes you have already created a token generation service.

Do not include development and testing codes, such as those generated in VxTokenGen.cs, in any final shipped build. Instead, write a new class that inherits from VxTokenGen.cs and overrides the existing functions. This sends the relevant information for each key out to the new secure token generation server.

Configure this new class to override the GetToken() method within VxTokenGen.cs. The following code displays an example of this class:

public class MyTokenGenOverride : VxTokenGen
{
    public override string GetToken(string issuer = null, TimeSpan? expiration = null, string userUri = null, string action = null, string tokenKey = null, string conferenceUri = null, string fromUserUri = null)
    {
        //Server Token Generation calls go here
    }
}

public void SetTokenOverride()
{
    Client.tokenGen = new MyTokenGenOverride();
}

Afterward, use this class to replace the value of the Client.tokenGen variable. All further calls through GetLoginToken, GetJoinToken, GetMuteForAllToken, and GetTranscriptionToken will route their UserUri and other assorted parameters through to the server generation code.