Switch password-based REST authentication on or off
Off refuses every REST call authenticated with the account password, before the password is checked, with a message pointing to API keys: a username/hash/timestamp signature (401), a login token request (403) and login + password on /rest (401).
Reference
POST https://YOUR-NETWORK-DOMAIN/rest-api/white-label/password-rest-auth.do
Off refuses every REST call authenticated with the account password, before the password is checked, with a message pointing to API keys: a username/hash/timestamp signature (401), a login token request (403) and login + password on /rest (401). API keys, the console and the AI assistant keep working. Takes effect at once on this server and within a minute on the others, and answers the saved setting, read back like the GET. Requires the WHITE_LABEL admin permission.
Form Params
allowedbooleanrequired
Accept REST calls authenticated with the account password; false refuses them
false
Responses
200
{allowed, sunset (yyyy-MM-dd or null), deprecatedSince (yyyy-MM-dd or null), nodeSecretConfigured, canSwitchOff, recentDays, recentPasswordUsers, recentPasswordUses: [{username, method (password_signature, password_login_token or password_plain), lastUsedAt, uses}]}
400
errors.allowed: switching off while the servers still sign calls between them with users' passwords (canSwitchOff false)
using var client = new HttpClient();
var request = new HttpRequestMessage(new HttpMethod("POST"), "https://YOUR-NETWORK-DOMAIN/rest-api/white-label/password-rest-auth.do");
request.Headers.Add("X-Api-Key", "YOUR_API_KEY");
request.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["allowed"] = "false" });
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());