I can ssh to the server and curl successfully with authentication:
`
$ curl --user user:password http://localhost:8080/api/v1/clusters
{
“href” : “http://localhost:8080/api/v1/clusters”,
“items” :
}
`
But when I try to use Ansible to get the same url with the same credentials, it fails to authenticate. My task looks like this:
`
- uri:
url: http://localhost:8080/api/v1/clusters
method: GET
user: “user”
password: “password”
`
I get an authentication error from my web service:
`
failed: [172.98.1.129] => {“content”: “{\n "status": 403,\n "message": "Full authentication is required to access this resource"\n}”, “content_length”: “91”, “content_type”: “text/plain;charset=ISO-8859-1”, “failed”: true, “redirected”: false, “server”: “Jetty(7.6.7.v20120910)”, “set_cookie”: “AMBARISESSIONID=7ek08rb33476kg9z8jyiw40y;Path=/”, “status”: 403}
msg: Status code was not [200]
`
I’m definitely using the correct username and password in both places.
So my question is how does the uri module’s authentication differ from curl?