curl - Jive REST API 返回 {"code":401 ,"message" :"Bad credentials"} using Basic Auth

标签 curl basic-authentication restful-authentication http-status-code-401 jive

这可能不是特定于 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.

来源:https://community.jivesoftware.com/thread/273582

关于curl - Jive REST API 返回 {"code":401 ,"message" :"Bad credentials"} using Basic Auth,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29377067/

相关文章:

php - 来自 WikiMedia API 的 cURL HTTP 请求不起作用

带有 cURL 的 Android NDK 包含错误

curl - 如何在Logstash中将事件标记为 “Looked At”

url - 当 URL 中提供凭据时,为什么浏览器不发送 Authentication header ?

apache - Apache 背后的 Artifactory 使用基本身份验证和匿名浏览

ruby-on-rails - 从 Restful 身份验证迁移到设计

c# - 如何使用 C# 访问 Yelp Fusion Api 的 OAuth2 token

curl - 在 Curl 中使用 Bing Speech 示例

wcf - RESTful WCF 安全/身份验证和 jQuery AJAX 调用

rest - 具有基本身份验证 XMLHttpRequest 的 Tomcat7 REST 服务