【问题标题】:Create user via scim in WorkPlace在 WorkPlace 中通过 scim 创建用户
【发布时间】:2017-04-26 15:13:53
【问题描述】:

我在通过 scim 和 javascript 在 WorkPlace 中创建用户时遇到问题。 这是我的代码:

var url2 = "https://www.facebook.com/company/xxxxxxxxxxx/scim/Users/";
  var options2 = {
    'method' : 'POST',
    'headers': headers,
    'Accept': 'application/json',
    'Content-Type': 'application/json',
    //body: JSON.stringify(userJson),
    'muteHttpExceptions' : true,
    //body: userJson
    'body': JSON.stringify({"userName":"xxx.xxx@xxxxxx-group.com","name":{"familyName":"Jensen","givenName":"Barbara"},"active":true,"schemas":["urn:scim:schemas:core:1.0"]})
  };
  var response2 = UrlFetchApp.fetch(url2,options2);

但是这段代码返回一个错误:

[17-04-26 07:55:39:939 PDT] {
   "Errors": [
      {
         "description": "[field:schemas]Invalid Request: Your request can't be parsed or has incorrect syntax.",
         "code": 1789003
      }
   ]
}

关于解决方案的任何想法? 谢谢 JPA

【问题讨论】:

  • 不要尝试抓取 Facebook。使用 API。

标签: facebook scim


【解决方案1】:

查看http://www.simplecloud.info/#implementations

SCIM

POST /v2/Users  HTTP/1.1
Accept: application/json
Authorization: Bearer h480djs93hd8
Host: example.com
Content-Length: ...
Content-Type: application/json

{
  "schemas":["urn:ietf:params:scim:schemas:core:2.0:User"],
  "externalId":"bjensen",
  "userName":"bjensen",
  "name":{
    "familyName":"Jensen",
    "givenName":"Barbara"
  }
}

【讨论】:

    【解决方案2】:

    这些错误通常发生在您没有在工作场所传递强制性属性以创建用户时。

    在您的创建请求中包含以下属性并检查 -

    一个。用户名

    b.名字

    c。活跃

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-01-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多