Logo
Section 1 / 3

获取和更新泄露密码检测设置

学习如何使用 Auth0 API 检索和更新泄露密码检测设置。

导入

获取和更新泄露密码检测设置

学习如何使用 Auth0 API 检索和更新泄露密码检测设置。

...
更新和获取泄露密码检测设置
...
1// 导入库 2const fetch = require('node-fetch'); 3 4const endpointUrl = new URL('https://{{DOMAIN}}/api/v2/attack-protection/breached-password-detection'); 5 6const headerParameters = { 7 'Content-Type': 'application/json', 8 'Authorization': 'Bearer {{ACCESS_TOKEN}}', 9}; 10 11const options = { 12 method: 'GET', 13 headers: headerParameters, 14}; 15 16async function getBreachPasswordDetection() { 17 try { 18 const response = await fetch(endpointUrl, options); 19 printResponse(response); 20 } catch (error) { 21 printError(error); 22 } 23} 24 25getBreachPasswordDetection();

参数名描述
enabled定义是否启用泄露密码检测功能。
shields包含在检测到密码泄露时将采取的处理措施。可选值包括:block(阻止)、user_notification(用户通知)和 admin_notification(管理员通知)。
admin_notification_frequency定义管理员邮件通知的频率。
method定义用于检测密码泄露的方法。

参数名称类型分类描述
enabled布尔值可选定义是否启用泄露密码检测功能。
shields数组可选定义在检测到密码泄露时应执行的操作。可用值为:block、user_notification 和 admin_notification。
admin_notification_frequency数组可选定义管理员邮件通知的频率。可用值为:immediately(立即)、daily(每日)、weekly(每周)和 monthly(每月)。
method字符串可选定义用于检测密码泄露的方法。可用值为:standard(标准)和 enhanced(增强)。
1// 导入库 2const fetch = require('node-fetch'); 3 4const endpointUrl = new URL('https://{{DOMAIN}}/api/v2/attack-protection/breached-password-detection'); 5 6const headerParameters = { 7 'Content-Type': 'application/json', 8 'Authorization': 'Bearer {{ACCESS_TOKEN}}', 9}; 10 11const bodyParameters = JSON.stringify({ 12 "enabled": true, 13 "shields": [ 14 "admin_notification" 15 ], 16 "admin_notification_frequency": [ 17 "daily" 18 ], 19}); 20 21const options = { 22 method: 'PATCH', 23 headers: headerParameters, 24 body: bodyParameters, 25}; 26 27async function updateBreachPasswordDetection() { 28 try { 29 const response = await fetch(endpointUrl, options); 30 printResponse(response); 31 } catch (error) { 32 printError(error); 33 } 34} 35 36updateBreachPasswordDetection();

用户与角色

获取和更新暴力破解配置