拒绝Cognito用户池中的注册请求 [英] Denying a Sign-up request in Cognito User Pools
问题描述
Cognito用户池预注册Lambda触发器的描述为:
The description of a Cognito User Pools Pre Sign-up Lambda Trigger is:
在用户提交其信息时调用此触发器进行注册,允许您执行自定义验证以接受或拒绝注册请求。
This trigger is invoked when a user submits their information to sign up, allowing you to perform custom validation to accept or deny the sign up request.
我要拒绝注册根据我的Lambda中的特定条件提出要求。触发参数(从以下文档中复制)似乎仅支持自动验证和自动确认:
I want to deny a sign-up request based on a certain condition in my Lambda. The trigger parameters (reproduced from the docs below) seem to only support auto-verification and auto-confirmation:
{
"request": {
"userAttributes": {
"string": "string",
....
},
"validationData": {
"string": "string",
"string": "string",
....
}
},
"response": {
"autoConfirmUser": "boolean",
"autoVerifyPhone": "boolean",
"autoVerifyEmail": "boolean"
}
}
如何根据预签名的结果接受或拒绝注册请求,了Lambda触发器?
How can I accept or deny a sign-up request based on the outcome of the Pre Sign-up Lambda Trigger?
推荐答案
您可以从lambda返回一个空字典来拒绝注册请求。同样,您返回事件值本身以接受注册请求。
You can return a empty dict from the lambda to deny sign up request. Similarly you return the event value itself to accept the sign up request.
def lambda_handler(event, context):
if denySignUp:
return {}
else:
return event
这篇关于拒绝Cognito用户池中的注册请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!