beforeCreate阻塞函数(Google Identity Platform)期间修改用户时的JSON响应格式



我正试图在beforeCreate阻塞函数中使用Go运行时来修改Google Identity Platform中新建的用户。到目前为止,我已经解析并验证了JWT,我能够阻止或允许用户注册,但我不知道谷歌在修改正在处理的用户时期望得到什么JSON响应。

这些文档是专门为使用Node.js SDK的开发人员编写的,在使用Go运行时实现相同功能时,没有提及预期的JSON响应。我尝试在JSON响应中使用{"disabled":"true"},但在NodeJSSDK之外不起作用。有什么想法吗?

在创建之前修改用户的完整JSON响应模式如下:

{
"userRecord": {
"updateMask": "customClaims,disabled,displayName,emailVerified,photoUrl",
"customClaims": {
"exampleRole": "ExampleUserRole",
"otherExampleClaim": "ExampleUserClaim2",
"otherExampleUserProperty": "ExampleUserClaim3"
},
"disabled": true,
"displayName": "Example Name",
"emailVerified": false,
"photoUrl": "https://localhost/image.jpg"
}
}

禁用新用户,例如:

{
"userRecord": {
"updateMask": "disabled",
"disabled": true
}
}

最新更新