AppWebsocket cross-service authentication

The login for appwebsocket connections can be done in two ways.

The IAppWebsocketAuthenticator interface is used by IAppWebsocketClient for the latter option.

File information

Filecommon/interface/services.h

Classes IAppWebsocketAuthenticator
UAppWebsocketAuthenticator

Classes

IAppWebsocketAuthenticator

class IAppWebsocketAuthenticator {
public:
    virtual ~IAppWebsocketAuthenticator() {};
    virtual void SetUser(class UAppWebsocketAuthenticator * user) = 0;
    virtual void GetLogin(const char * app, const char * challenge) = 0;
};

Overview

The interface provides the GetLogin function for getting a login for the desired service.

Public functions

SetUser
Sets the UAppWebsocketAuthenticator object that shall receive the callbacks.

Parameters

class UAppWebsocketAuthenticator * userThe UAppWebsocketAuthenticator object that shall receive the callbacks.
GetLogin
Requests an appwebsocket login for a specified app instance. Will result in one of the callbacks defined by UAppWebsocketAuthenticator.

Parameters

cconst char * appThe SIP URI of the remote app service.
cconst char * challengeThe challenge specified by the remote app service.

UAppWebsocketAuthenticator

class UAppWebsocketAuthenticator {
public:
    virtual void AppWebsocketAuthenticatorClosed(class IAppWebsocketAuthenticator * authenticator) = 0;
    virtual void AppWebsocketAuthenticatorGetLoginResult(class IAppWebsocketAuthenticator * authenticator, 
        const char * domain, 
        const char * sip, 
        const char * guid, 
        const char * dn, 
        const char * pbxObj, 
        const char * app, 
        const char * info, 
        const char * digest, 
        const char * salt, 
        const char * key) = 0;
    virtual void AppWebsocketAuthenticatorGetLoginError(class IAppWebsocketAuthenticator * authenticator) = 0;
};

Overview

Base class for applications that use the library.

Public functions

AppWebsocketAuthenticatorClosed
The connection used for authentication was closed during the request. Thus the authentication has failed.

Parameters

class IAppWebsocketAuthenticator * authenticatorA pointer to the source of the callback.
AppWebsocketAuthenticatorGetLoginResult
The PBX granted access to the remote app instance and returned the given parameters for login.

Parameters

class IAppWebsocketAuthenticator * authenticatorA pointer to the source of the callback.
const char * domainThe domain of the client.
const char * sipThe SIP URI of the client.
const char * guidThe GUID of the client.
const char * dnThe display name of the client.
const char * pbxObjThe name of the PBX object of the remote app instance.
const char * appThe app name of the remote app instance.
const char * infoA JSON structure containing additional info about the client.
const char * digestThe response digest prooving the successful authentication.
const char * saltA salt that is used for the encryption of the key parameter.
const char * keyAn encrypted session key for the connection between the client and the remote app service.

Remarks

All the paramters are protected by the digest. They must not be modified before passing them to the remote app service. Otherwise the authentication will fail.