{"action":"created","issue":{"url":"https://api.github.com/repos/centreon/centreon/issues/4903","repository_url":"https://api.github.com/repos/centreon/centreon","labels_url":"https://api.github.com/repos/centreon/centreon/issues/4903/labels{/name}","comments_url":"https://api.github.com/repos/centreon/centreon/issues/4903/comments","events_url":"https://api.github.com/repos/centreon/centreon/issues/4903/events","html_url":"https://github.com/centreon/centreon/issues/4903","id":201608515,"number":4903,"title":"\"Unauthorized\" when trying to query REST API via curl","user":{"login":"anzevi","id":12727931,"avatar_url":"https://avatars.githubusercontent.com/u/12727931?v=3","gravatar_id":"","url":"https://api.github.com/users/anzevi","html_url":"https://github.com/anzevi","followers_url":"https://api.github.com/users/anzevi/followers","following_url":"https://api.github.com/users/anzevi/following{/other_user}","gists_url":"https://api.github.com/users/anzevi/gists{/gist_id}","starred_url":"https://api.github.com/users/anzevi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anzevi/subscriptions","organizations_url":"https://api.github.com/users/anzevi/orgs","repos_url":"https://api.github.com/users/anzevi/repos","events_url":"https://api.github.com/users/anzevi/events{/privacy}","received_events_url":"https://api.github.com/users/anzevi/received_events","type":"User","site_admin":false},"labels":[{"id":33709295,"url":"https://api.github.com/repos/centreon/centreon/labels/Kind/Bug","name":"Kind/Bug","color":"fc2929","default":false},{"id":268911589,"url":"https://api.github.com/repos/centreon/centreon/labels/Kind/Documentation","name":"Kind/Documentation","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":{"login":"lpinsivy","id":3351916,"avatar_url":"https://avatars.githubusercontent.com/u/3351916?v=3","gravatar_id":"","url":"https://api.github.com/users/lpinsivy","html_url":"https://github.com/lpinsivy","followers_url":"https://api.github.com/users/lpinsivy/followers","following_url":"https://api.github.com/users/lpinsivy/following{/other_user}","gists_url":"https://api.github.com/users/lpinsivy/gists{/gist_id}","starred_url":"https://api.github.com/users/lpinsivy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lpinsivy/subscriptions","organizations_url":"https://api.github.com/users/lpinsivy/orgs","repos_url":"https://api.github.com/users/lpinsivy/repos","events_url":"https://api.github.com/users/lpinsivy/events{/privacy}","received_events_url":"https://api.github.com/users/lpinsivy/received_events","type":"User","site_admin":false},"assignees":[{"login":"lpinsivy","id":3351916,"avatar_url":"https://avatars.githubusercontent.com/u/3351916?v=3","gravatar_id":"","url":"https://api.github.com/users/lpinsivy","html_url":"https://github.com/lpinsivy","followers_url":"https://api.github.com/users/lpinsivy/followers","following_url":"https://api.github.com/users/lpinsivy/following{/other_user}","gists_url":"https://api.github.com/users/lpinsivy/gists{/gist_id}","starred_url":"https://api.github.com/users/lpinsivy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lpinsivy/subscriptions","organizations_url":"https://api.github.com/users/lpinsivy/orgs","repos_url":"https://api.github.com/users/lpinsivy/repos","events_url":"https://api.github.com/users/lpinsivy/events{/privacy}","received_events_url":"https://api.github.com/users/lpinsivy/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/centreon/centreon/milestones/73","html_url":"https://github.com/centreon/centreon/milestone/73","labels_url":"https://api.github.com/repos/centreon/centreon/milestones/73/labels","id":2166177,"number":73,"title":"2.8.3","description":"","creator":{"login":"julienmathis","id":2294502,"avatar_url":"https://avatars.githubusercontent.com/u/2294502?v=3","gravatar_id":"","url":"https://api.github.com/users/julienmathis","html_url":"https://github.com/julienmathis","followers_url":"https://api.github.com/users/julienmathis/followers","following_url":"https://api.github.com/users/julienmathis/following{/other_user}","gists_url":"https://api.github.com/users/julienmathis/gists{/gist_id}","starred_url":"https://api.github.com/users/julienmathis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julienmathis/subscriptions","organizations_url":"https://api.github.com/users/julienmathis/orgs","repos_url":"https://api.github.com/users/julienmathis/repos","events_url":"https://api.github.com/users/julienmathis/events{/privacy}","received_events_url":"https://api.github.com/users/julienmathis/received_events","type":"User","site_admin":false},"open_issues":14,"closed_issues":30,"state":"open","created_at":"2016-11-30T12:27:05Z","updated_at":"2017-01-19T13:18:27Z","due_on":"2017-01-05T08:00:00Z","closed_at":null},"comments":3,"created_at":"2017-01-18T15:39:05Z","updated_at":"2017-01-19T13:20:21Z","closed_at":null,"body":"Hi,\r\n\r\nI'm unable to get any valid response back from REST API. User has the permission to reach API, I can get the token, but whenever I try to query API via curl i get 401  `\"Unauthorized\"` back.\r\n\r\n---------------------------------------------------\r\nBUG REPORT INFORMATION\r\n---------------------------------------------------\r\n**Centreon version**: centreon-2.8.2\r\n\r\n**Centreon Web version**: centreon-web-2.8.2\r\n\r\n**Centreon Engine version**: centreon-engine-1.6.2\r\n\r\n**Centreon Broker version**: centreon-broker-3.0.3\r\n\r\n**OS**: CentOS Linux release 7.3.1611 (Core)\r\n\r\n**Additional environment details (AWS, VirtualBox, physical, etc.):** vmware\r\n\r\n**Steps to reproduce the issue:**\r\n1. setup user to allow access to REST api\r\n2. get token for this user:\r\n```\r\ncurl -s --data 'username=<username>&password=<password>' 'http://centreon.home.local/centreon/api/index.php?action=authenticate'\r\n```\r\n3. Run this curl to list hosts:\r\n```\r\ncurl -s 'http://centreon.home.local/centreon/api/index.php?action=action&object=centreon_clapi' -H 'Content-Type: application/json' -H 'centreon_auth_token: XXXXXXXXXXXXXXXXXXXXXX=' --data 'action=show&object=HOST'\r\n```\r\n\r\n**Describe the results you received:** `\"Unauthorized\"`\r\n\r\n\r\n\r\n**Additional information you think important (e.g. issue happens only occasionally):**\r\nI tried this with different users, with different permission, every time is the same response. \r\n\r\n- PHP 5.3.3\r\n- httpd-2.2.15"},"comment":{"url":"https://api.github.com/repos/centreon/centreon/issues/comments/273774308","html_url":"https://github.com/centreon/centreon/issues/4903#issuecomment-273774308","issue_url":"https://api.github.com/repos/centreon/centreon/issues/4903","id":273774308,"user":{"login":"lpinsivy","id":3351916,"avatar_url":"https://avatars.githubusercontent.com/u/3351916?v=3","gravatar_id":"","url":"https://api.github.com/users/lpinsivy","html_url":"https://github.com/lpinsivy","followers_url":"https://api.github.com/users/lpinsivy/followers","following_url":"https://api.github.com/users/lpinsivy/following{/other_user}","gists_url":"https://api.github.com/users/lpinsivy/gists{/gist_id}","starred_url":"https://api.github.com/users/lpinsivy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lpinsivy/subscriptions","organizations_url":"https://api.github.com/users/lpinsivy/orgs","repos_url":"https://api.github.com/users/lpinsivy/repos","events_url":"https://api.github.com/users/lpinsivy/events{/privacy}","received_events_url":"https://api.github.com/users/lpinsivy/received_events","type":"User","site_admin":false},"created_at":"2017-01-19T13:20:21Z","updated_at":"2017-01-19T13:20:21Z","body":"commit bb3f201"}}
{"actor":{"display_login":"lpinsivy"}}