使用 Salesforce Web 服务 API 是否可以检查(或查询)用户是否被锁定(如果他们尝试登录失败的次数过多,因此被阻止登录)?
最佳答案
虽然 User 对象上没有特定的字段来指示他们被锁定,但您可以查询 LoginHistory
对象。
select Id, UserId, LoginTime, Status from LoginHistory where
UserId = 'xxxxxxxxx' order by LoginTime desc limit 20
然后遍历结果,检查 Status
字段的值。如果用户已被锁定,则最近的登录尝试将在此字段中具有“密码锁定”值。
此 Status
字段的其他可能值包括:
- 成功
- 用户不活跃
- 密码无效
- 失败:需要 API 安全 token
- 失败:计算机激活挂起
- 失败:需要激活计算机
- 失败:无效的时间戳
- 失败:需要移动许可证
关于salesforce - 是否可以检查用户是否被锁定?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11581806/