繁体   English   中英

JSON 在 beforeCreate 阻塞期间修改用户时的响应格式 function(Google 身份平台)

[英]JSON response format when modifying user during beforeCreate blocking function (Google Identity Platform)

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

The docs are written exclusively for developers using the Node.js SDK, and don't mention the expected JSON response when implementing the same using the Go runtime. 我尝试在我的 JSON 响应中使用{"disabled":"true"} ,但这在 NodeJS SDK 之外不起作用。 有什么想法吗?

Go 中编写的 beforeCreate function 阻塞现已启动并运行。 我必须设置一个本地 Node.js 环境来捕获 Node.js SDK 生成的响应到 beforeCreate 阻塞函数。

在创建之前修改用户的完整 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
  }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM