Jenkins API身份验证403

时间:2014-09-30 09:34:09

标签: api jenkins remote-access

我试图通过其远程API访问Jenkins实例。我使用如下命令:

`curl -v -X GET https://jenkins.somewhere.com/job/trt/api/xml --user user@gmail.com:abc123abc123abc123acb123`

用户ID和API令牌来自我的用户页面。 Jenkins实例受到保护,可以使用Google Apps SSO作为其安全领域,并使用基于角色的授权策略。我的用户是一个拥有所有权限的角色,但我收到了403响应,而且似乎认为我是#34;匿名"用户(以下回复)。如何诊断出错?

< HTTP/1.1 403 Forbidden
< Date: Tue, 30 Sep 2014 09:29:49 GMT
* Server Jetty(8.y.z-SNAPSHOT) is not blacklisted
< Server: Jetty(8.y.z-SNAPSHOT)
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Content-Type: text/html;charset=utf-8
< X-Hudson: 1.395
< X-Jenkins: 1.574
< X-Jenkins-Session: 0a2fc55a
< X-Hudson-CLI-Port: 37761
< X-Jenkins-CLI-Port: 37761
< X-Jenkins-CLI2-Port: 37761
< X-You-Are-Authenticated-As: anonymous
< X-You-Are-In-Group: 
< X-Required-Permission: hudson.model.Hudson.Read
< X-Permission-Implied-By: hudson.security.Permission.GenericRead
< X-Permission-Implied-By: hudson.model.Hudson.Administer
< Set-Cookie: JSESSIONID.cf04cd2b=rdgbn9cxz0s045quzsaybywo;Path=/
< Via: 1.1 jenkins.somewhere.com
< Vary: Accept-Encoding
< Content-Length: 578
< 
<html><head><meta http-equiv="refresh" content="1;url=/securityRealm/commenceLogin?from=%2Fjob%2Ftrt%2Fapi%2Fxml"><script>window.location.replace('/securityRealm/commenceLogin?from=%2Fjob%2Ftrt%2Fapi%2Fxml');</script></head><body style="background-color:white; color:white;">


Authentication required
<!--
You are authenticated as: anonymous
Groups that you are in:

Permission you need to have (but didn't): hudson.model.Hudson.Read
 ... which is implied by: hudson.security.Permission.GenericRead
 ... which is implied by: hudson.model.Hudson.Administer
-->

0 个答案:

没有答案