这可能不是特定于 Jive API,而是一般的基本身份验证。
这不是联合帐户。
我正在尝试使用 cURL 向 Jive REST API v3 发出简单请求:
curl --include --verbose --user {USERNAME}:{PASSWORD} 'https://sandbox.jiveon.com/api/core/v3/search/contents?filter=search(test)'
我也尝试过:
curl -v -u USERNAME "https://sandbox.jiveon.com/api/core/v3/contents?count=100&startIndex=200"
我可以使用我的凭据登录用户界面(无论如何,我无论如何都拥有“完全访问”权限)。为什么会抛出 401?我的身份验证格式是否错误?
这是我正在遵循的示例:
https://developer.jivesoftware.com/rest
以下是相关结果:
Trying 23.221.10.251...
Connected to sandbox.jiveon.com (23.221.10.251) port 443 (#0)
TLSv1.0, TLS handshake, Client hello (1):
TLSv1.0, TLS handshake, Server hello (2):
TLSv1.0, TLS handshake, CERT (11):
TLSv1.0, TLS handshake, Server finished (14):
TLSv1.0, TLS handshake, Client key exchange (16):
TLSv1.0, TLS change cipher, Client hello (1):
TLSv1.0, TLS handshake, Finished (20):
TLSv1.0, TLS change cipher, Client hello (1):
TLSv1.0, TLS handshake, Finished (20):
SSL connection using TLSv1.0 / AES128-SHA
Server certificate:
subject: OU=Domain Control Validated; OU=COMODO SSL Wildcard; CN=*.jiveon.com
start date: 2014-06-23 00:00:00 GMT
expire date: 2015-07-31 23:59:59 GMT
subjectAltName: sandbox.jiveon.com matched
issuer: C=GB; ST=Greater Manchester; L=Salford; O=COMODO CA Limited; CN=COMODO SSL CA 2
SSL certificate verify ok.
Server auth using Basic with user 'USERNAME OMITTED HERE'
GET /api/core/v3/contents?count=100&startIndex=200 HTTP/1.1
Authorization: Basic xxxxxxxxxxxxxxxxxx= (I verified this decoded properly in base64)
User-Agent: curl/7.41.0
Host: sandbox.jiveon.com
Accept: */*
HTTP/1.1 401 Unauthorized
最佳答案
为了将来进行故障排除,还会显示错误401 Unauthorized, 当 Jive 实例配置了SSO 登录,并且您使用联合用户帐户进行 API 调用时。
You can't use a federated user account to authenticate your API calls. You must create a non-federated, 'system' account that you can use to authenticate API calls.
关于curl - Jive REST API 返回 {"code":401 ,"message" :"Bad credentials"} using Basic Auth,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29377067/