api - Sitecore RESTful API 身份验证不返回令牌
问题描述
在 Sitecore 中,我有一个项目,我想通过 API 访问该项目。所以我找到了这个文件: https ://doc.sitecore.com/developers/82/sitecore-experience-platform/en/the-restful-api-for-the-itemservice.html
我正在尝试使用“https:///sitecore/api/ssc/auth/login”通过 Postman 对其进行身份验证 响应状态为 200 OK。响应图像 登录过程
但是什么都没有回来,没有令牌,没有错误。 邮递员在登录时响应没有令牌
解决方案
你应该得到一个 Cookie 回来。在请求头中设置“<code>Content-Type: application/json”。并使用这样的东西
{
"domain": "sitecore",
"username": "admin",
"password": "b"
}
如果您有自签名证书,请SSL certification verification
从 Postman 的顶部菜单中的设置/常规中关闭。
关于https://sitecore-community.github.io/docs/documentation/Sitecore%20Services%20Layer/Play%20with%20Item%20Services/的提示,您可以下载具有正确设置的 Postman 文件以进行登录。