auth

TrueConfAbout 4 min

auth

Description: authorize the current connection.

The command is used for authenticating in multiple control modes for each type of protection.

Query example (Unprotected authorization):

{
    "method" : "auth",
    "requestId" : "1",
    "type" : "unsecured",
    "role" : "admin"
}

Query example (Secured authorization):

{
    "method" : "auth",
    "requestId" : "1",
    "type" : "secured",
    "credentials" : "some very secret string",
    "role" : "user"
}

Query example (Status change from administrator to user):

{
    "method" : "auth",
    "requestId" : "1",
    "role" : "user"
}

Response example:

{
    "method": "auth",
    "requestId" : "1",
    "previleges": 2,
    "token": "1*Cwk7m2fznHFi0t02*99235446*4145443734323733424642364342343533393737393543374636333936383238",
    "tokenForHttpServer": "4*MKYl5cDyBcJrKUez*96643746*4139444242343336304535343243323846374130304337424641464139394633",
    "result": true,
    "resultCode" : 0
}

Parameter description:

  • type - authentication type. Depending on the authentication type, the parameter can take the following values:

    • Secured authentication - the value must be secured, and it can be by password, by PIN, or by token. In this case, you need to specify the PIN, password, or token in the credentials parameter accordingly.

    • Unsecured authorization β€” the parameter is present and the value will be equal to unsecured

    • Status change from administrator to user β€” is not included

  • role - purpose. Depending on the type of authorization, the parameter can take the following values:

    • Secure authorization, Non-secure authorization are optional parameters. If present, they indicate the resulting connection mode (admin or user) and serve as its verification. If the parameter is absent, the mode will be assigned automatically without verification.

    • Status change from administrator to user β€” required and must be equal to admin

  • credentials - depending on the type of authorization, it contains a password, PIN, or token.

  • resultCode - the result of authorization, which takes the following numerical values:

    • 0 β€” Successful

    • 1 β€” Internal failure

    • 2 - authorization error because the current plan is not Pro

    • 3 - authorization error because the current connection is not authorized as an administrator.

    • 4 - authorization error because the current authentication credentials do not permit this type of security to be used

    • 5 - authorization error due to receiving privileges different from those required after authorization

    • 6 - authorization is unavailable due to frequent incorrect password entries. Please wait before attempting to authorize again.

    • 7 - authorization error due to empty credentials

    • 8 - authorization error due to incorrect credentials

    • 9 - authorization error due to an invalid role field value

    • 10 - authorization error due to an invalid type field value

    • 11 - authorization error due to the missing type parameter

    • 12 - authorization error due to missing credentials parameter

  • previleges β€” the resulting management mode. The following options are possible:

    • 1 β€” user

    • 2 β€” administrator

  • token β€” the token of the current connection that should be used in the API. It may be used for token authorization when the connection is lost and a new connection is established. The token lifetime depends on the type of authorization:

    • Unsecured authorization β€” 30 days or until the moment when the application is closed

    • with a password β€” 30 days or until the moment when the application is closed

    • by PIN - 30 days or until the application is closed

    • with a PIN entered from the command line β€” until the moment when the application is closed

    • by token - determined by the initial authorization during which it was obtained

    • "Switch to user from under administrator" is determined by the initial authorization during which it was obtained.

  • tokenForHttpServer β€” the current connection token. It will be used on the HTTP server. The token lifetime equals 5 minutes or until the moment when the application is closed

  • overlayHttpToken - a token for use on an HTTP server in the overlay functionality. The token remains valid until the authorization data is changed (setAuthParams), until logout, or until the start or end of a call or group conference.

  • requestId - a unique request identifier. You can find more details about it here.

See also: