ApiRTC users authentication

Two different mode are available to authenticate your apiRTC users :

Authentication Process using JSON Token

To configure authentication with JSON token you need to change your configuration in apiRTC Dashboard in menu API / Authentication

Activate JSON Token authentication :

You can also generate your secret key.


On your ApiRTC client, you simply have to use your JSON token in registerInformation.token parameter :

    registerInformation.id = "my-apiRTC-UserAgent-Id"
    registerInformation.token = "my-JSON-Token"

    ua.register(registerInformation).then(function(session) {
        // Save session
        connectedSession = session;
    }).catch(function(error) {
        // error
        console.error('User agent registration failed', error);
    });


Check our blog, to get information about JSON token generation

Authentication Process with your authentication server

To configure authentication with a third party authentication server, you need to change your configuration in apiRTC Dashboard in menu API / Authentication

Activate Authentication with third party server :

You can then define your authentication server URL.


In order to authenticate your users, following process can be applied :

    registerInformation.token = "myToken"

    ua.register(registerInformation).then(function(session) {
        // Save session
        connectedSession = session;
    }).catch(function(error) {
        // error
        console.error('User agent registration failed', error);
    });
        {"result":true} or {"result":false}

Note : with apiRTC V3, you need to use following code :

    apirtc.init({
        apiKey : "myDemoApiKey",
        apiCCId : "2345",
        token : "abcdefghijklmnopqrst"
        onReady : sessionReadyHandler
    })