# 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
.
In order to set the secure mode for the user
, it is necessary to set the secure
mode for the administrator
first.
** 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 passwordpin
- by PIN. A new PIN will be received in the 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 for the current connection to be used in the API. If the connection is lost and a reconnection occurs, it can be used for token-based authorization. It is present if the security type for the user under which the current connection is being made has been changed. The lifespan of the token depends on the type of authentication 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 closedwith 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 closednewPin
- new PIN. This field is present if PIN protection was set:"authType" : "pin"
requestId
- a unique request identifier. You can learn more about it here.
See also: