跳到主要内容

updateTfaSettings

BooleanWrapper updateTfaSettings(TfaRequestDto)

PUT /api/2.0/settings/tfaapp

Update the TFA settings

Sets the portal-wide two-factor authentication policy: type 1 switches on the SMS method, 2 switches on the authenticator application, and 0 turns TFA off, as does any unknown value. The two methods are mutually exclusive, so switching one on switches the other off. The caller has to be the portal owner or a DocSpace administrator; other members are refused, and a request that names the owner's account in id or in mandatoryUsers is refused unless id carries the caller's own account. trustedIps takes single addresses, inclusive ranges and CIDR blocks, and an unparseable entry is rejected as an invalid request; accounts listed in mandatoryUsers or mandatoryGroups still have to pass the challenge even from a trusted address. Switching a method on is disruptive: it resets the portal's authentication cookies, so every session on the portal, the caller's own included, has to sign in again. The answer is true when a method was switched on and false when TFA was turned off. Use PUT api/2.0/settings/tfaappwithlink instead to receive the caller's own confirmation link in the same step.

Parameters​

NameInTypeDescriptionNotes
TfaRequestDtobodyTfaRequestDto[optional]

Responses​

Status codeDescriptionTypeResponse headers
200true when the SMS or the authenticator method was switched on, false when TFA was turned offBooleanWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400The request body cannot be read, type is null, an empty string or a string that is neither a number nor built from the names None, Sms and App, or a trustedIps entry is not a single address, an inclusive range or a CIDR block--
403The caller has no portal-settings right, or names the owner's account in id or mandatoryUsers while id is not the caller's own--
405The requested method is not enabled on this portal, or the SMS method has no configured provider--
401UnauthorizedErrorApiResponse-
429Too Many Requests.ErrorApiResponseRetry-After
500Internal Server Error.ErrorApiResponse-
502Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON.--
503Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON.--

Return type​

BooleanWrapper

Authorization​

Basic, OAuth2 (scopes: read, write), ApiKeyBearer, asc_auth_key, Bearer, OpenId

HTTP request headers​

  • Content-Type: application/json
  • Accept: application/json