# setAuthParams

Description: select a new type of protection for controlling VideoSDK/Room either as a user or administrator.

If the Unprotected authorization type is selected for the administrator, the same authorization type will be selected for the user.

To set the protected mode for user, first you need to set the protected mode for administrator.

** Example of request (Setting "Password authorization")**:

{
    "method" : "setAuthParams",
    "requestId" : "1",
    "userType" : "admin",
    "authType" : "password",
    "password" : "123456"
}

Example of request (Setting "_PIN _" authorization):

{
    "method" : "setAuthParams",
    "requestId" : "1",
    "userType" : "admin",
    "authType" : "pin"
}

Example of request ( Authorization type "Unprotected"):

{
    "method" : "setAuthParams",
    "requestId" : "1",
    "userType" : "admin",
    "authType" : "unsecured"
}

Response example:

{
    "result" : true,
    "newPin" : "ABC123",
    "method" : "setAuthParams",
    "requestId" : "1"
}

Parameter description:

  • authType — Authorization type. It can be as follows:

    • password — with a password

    • pin - by pin. A new pin will be received in response.

    • unsecured — Unsecured

  • userType — Type of account to be protected. It can be admin or user (upon availability).

  • password — Password. This field must be available when setting up password protection.

  • token - the token of current connection to be used in API. In case of connection failure and reconnection, it can be used for authorization via token. It is present if the authentication type has been changed for the user under which the current connection is being executed. The token's lifespan depends on the authentication type being used:

    • "authType" : "unsecured" (unsecured authorization) — 30 days or until the moment when the application is closed

    • "authType" : "password" (with a password) — 30 days or until the moment when the application is closed

    • "authType" : "pin" (by PIN) — for 24 hours or until the application is closed

    • with a token — determined by the initial authorization during which the token was received

  • 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

  • newPin - new PIN. The field is present if the protection type was set to pin: "authType" : "pin"

  • requestId - unique request identifier. More details can be found here

See also: