1.1.3 Authorization

The AppName item is used for application identification. The application cannot continue communicating until it receives the <bind Status="OK"/> reply from the 2N® NetSpeaker Server. The server thus confirms the connection and creation of a communication channel.

 

Explicit authorization – LOGON method

You can enter your login and password simply as follows:

  1. Check whether the library offers the LOGON method after receiving the request for authorization and, if yes, then:
  2. Send the instruction <auth Method="LOGON" LoginName="..." Password="..."/>; where ... is to be replaced with the user name and password (default name: Admin, password: 2n).
  3. Wait for the reply: <auth Method="LOGON" Status="OK"/>.

If the reply contains the Status attribute with OK value, it means that the XML bridge has been successfully authorized with the data received. Any different value of the Status attribute means that access has been denied.

Besides the <auth Method="..." Status="OK"/> reply, successful authorization is manifested by the following reply from the XML bridge to bind: <bind Status="OK"/>. This signals that the communication channel has been successfully configured and authorized and is ready for sending messages in both directions now.

Request

<bind ConnType="LOCAL" AppName="NetSpkApiTest"/>

Response

<auth>
<method Name="LOGON"/>
</auth>

Request

<auth Method="LOGON" LoginName="login" Password="password"/>

Response

<auth Method="LOGON" Status="OK"/>

Response

<bind Status="OK"/>

 

The following answers to auth have been added for different situations:

OK ... authorization successfull

LOGON_DENIED ... authorization was not successfull, wrong login params added - command <auth /> can be repeated with other login params

 

The following answers to bind have been added for different situations:

OK ... external application can start sending other commands.

ALREADY_BOUND ... application ignores this error and can send commands, bind no longer needed.

NEIGHBOUR_IS_UNREADY ... application must repeat the bind command after a time delay of 100 ms at least.

ALREADY_IN_PROGRESS .... application must wait to auth or bind response, because autorization process alredy runs

UNBOUND_STREAM ......... application try to send commands earlier, than bind response comes

NOT_ALLOWED_HERE ....... application breach prescribed procedure bind and auth

No new commands can be sent until the CTI interface responds to the bind command.

If the application does not receive an answer in about 1 sec, it repeats the bind command.