简体   繁体   English

当我在 IBM Cloud 中使用管理 API 创建未来用户时,我无法获取属性

[英]I can not get attribute when i create future user with management API in IBM Cloud

I'm using App ID and I follow this tuts https://cloud.ibm.com/docs/services/appid?topic=appid-tutorial-roles for my personal project.我正在使用 App ID,并且我为我的个人项目遵循这个 tuts https://cloud.ibm.com/docs/services/appid?topic=appid-tutorial-roles

I tried to call API {{APPID_MANAGEMENT_SERVER_HOST}}/management/v4/{{APPID_TENANT_ID}}/users with body:我试图用正文调用 API {{APPID_MANAGEMENT_SERVER_HOST}}/management/v4/{{APPID_TENANT_ID}}/users:

  "idp": "cloud_directory",
  "idp-identity": "huynhdn@gmail.com",
  "profile": {
    "attributes": {
      "role": "MANAGER"
    }
  }
}

I get Future User in User Profiles!我在用户配置文件中获得了未来用户! => OK => 好的

Next, I call {{APPID_MANAGEMENT_SERVER_HOST}}/management/v4/{{APPID_TENANT_ID}}/cloud_directory/Users to set password for this user.接下来,我调用 {{APPID_MANAGEMENT_SERVER_HOST}}/management/v4/{{APPID_TENANT_ID}}/cloud_directory/Users 为该用户设置密码。

  "displayName": "Test User",
  "password": "abcd1234",
  "emails": [
    {
      "value": "huynhdn@gmail.com",
      "primary": true
    }
  ]
}

Finally, I call {{APPID_AUTH_SERVER_HOST}}/oauth/v4/{{APPID_TENANT_ID}}/token to get token with user created above, But when i check in app id: attribute "role" is gone :(最后,我调用 {{APPID_AUTH_SERVER_HOST}}/oauth/v4/{{APPID_TENANT_ID}}/token 来获取上面创建的用户令牌,但是当我签入应用程序 ID 时:属性“角色”消失了 :(

WHY?为什么? or Anyone can help me another way to create user has "username", "password", "attribute" with API management!或者任何人都可以帮助我用 API 管理创建具有“用户名”、“密码”、“属性”的用户的另一种方法!

The doc page you're referencing above states that in order to get future user attribute the user must validate ownership over email.您在上面引用的文档页面指出,为了获得未来的用户属性,用户必须验证对 email 的所有权。 You can either do it through standard means, or manually specifying status:confirmed when creating your CLoud Dir user, eg您可以通过标准方式执行此操作,也可以在创建 CLoud Dir 用户时手动指定 status:confirmed,例如

{
  "displayName": "John Smith",
  "password": "p4ssw0rd",
  "emails": [
    {
      "value": "john@example.com",
      "primary": true
    }
  ],
  "status":"CONFIRMED"
}```

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

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