PingFederate 8.2.2用于我们的系统。用于创建PF对象的所有REST API都是自动的,但/ sp / adapter(https://pfhost:9999/pf-admin-api/v1/sp/adapters)使用下面的JSON无效。手动如果我创建相同的配置它是有效的。下面提到的JSON是从已经手动创建的/sp/adapter中检索的。但是当我在API调用中使用相同的JSON时会出现如下错误,请帮助解决这个问题。
错误:
{
"resultId": "validation_error",
"message": "Validation error(s) occurred. Please review the error(s) and address accordingly.",
"validationErrors": [
{
"message": "'' is not a valid selection for 'Send Extended Attributes'",
"fieldPath": "configuration.fields[21].value",
"errorId": "plugin_validation_error"
}
]
}
JSON:
{
"id": "opentokenadapt1",
"name": "opentokenadapt1",
"pluginDescriptorRef": {
"id": "com.pingidentity.adapters.opentoken.SpAuthnAdapter"
},
"configuration": {
"tables": [],
"fields": [
{
"name": "Password",
"value": "Password123"
},
{
"name": "Confirm Password",
"value": "Password123"
},
{
"name": "Transport Mode",
"value": "2"
},
{
"name": "Token Name",
"value": "opentoken"
},
{
"name": "Cipher Suite",
"value": "2"
},
{
"name": "Authentication Service",
"value": ""
},
{
"name": "Account Link Service",
"value": ""
},
{
"name": "Logout Service",
"value": ""
},
{
"name": "Cookie Domain",
"value": ""
},
{
"name": "Cookie Path",
"value": "/"
},
{
"name": "Token Lifetime",
"value": "300"
},
{
"name": "Session Lifetime",
"value": "43200"
},
{
"name": "Not Before Tolerance",
"value": "0"
},
{
"name": "Force SunJCE Provider",
"value": "false"
},
{
"name": "Use Verbose Error Messages",
"value": "false"
},
{
"name": "Obfuscate Password",
"value": "true"
},
{
"name": "Session Cookie",
"value": "false"
},
{
"name": "Secure Cookie",
"value": "false"
},
{
"name": "HTTP Only Flag",
"value": "true"
},
{
"name": "Send Subject as Query Parameter",
"value": ""
},
{
"name": "Subject Query Parameter ",
"value": ""
},
{
"name": "Send Extended Attributes",
"value": ""
},
{
"name": "Skip Trimming of Trailing Backslashes",
"value": "false"
}
]
},
"attributeContract": {
"coreAttributes": [
{
"name": "subject"
}
],
"extendedAttributes": [
{
"name": "nsroles"
}
]
}
}
答案 0 :(得分:3)
"发送扩展属性"需要一个有效的值(不是你给它的空字符串)。可能的值是" 0" (无)," 1" (Cookies)或" 2" (查询参数)。
尝试缩小这些问题的一个提示:尝试在PingFederate管理控制台(UI)中构建SP适配器实例,然后将其与您从API获取的JSON模型进行比较。