跳到主要内容

updateTfaSettingsLink

StringWrapper updateTfaSettingsLink(TfaRequestDto)

PUT /api/2.0/settings/tfaappwithlink

Update TFA settings with a link

Applies the same portal-wide two-factor authentication change as PUT api/2.0/settings/tfaapp and additionally returns the confirmation link the caller needs to pass the new challenge, so an administrator who has just switched TFA on can go straight to setting it up for themselves. The caller has to be the portal owner or a DocSpace administrator, and a request that names the owner's account in id or in mandatoryUsers is refused unless id carries the caller's own account. Every effect of the plain call applies here too: the methods are mutually exclusive, type 0 turns TFA off, trustedIps and the two mandatory lists behave the same way, and switching a method on resets the portal's authentication cookies, so all sessions have to sign in again. The answer is an empty string whenever there is no link to hand out: when the request turned TFA off, and when the caller is exempt from the challenge, most often because their own address is in the trustedIps list of that very request. The cookie the link depends on is not returned here, read it with GET api/2.0/settings/tfaapp/confirm.

Parameters​

NameInTypeDescriptionNotes
TfaRequestDtobodyTfaRequestDto[optional]

Responses​

Status codeDescriptionTypeResponse headers
200The caller's own confirmation link, or an empty string when TFA was turned off or the caller is exemptStringWrapperX-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​

StringWrapper

Authorization​

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

HTTP request headers​

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