{"action":"closed","issue":{"url":"https://api.github.com/repos/woothemes/woocommerce/issues/8256","labels_url":"https://api.github.com/repos/woothemes/woocommerce/issues/8256/labels{/name}","comments_url":"https://api.github.com/repos/woothemes/woocommerce/issues/8256/comments","events_url":"https://api.github.com/repos/woothemes/woocommerce/issues/8256/events","html_url":"https://github.com/woothemes/woocommerce/issues/8256","id":82775778,"number":8256,"title":"API does not prompt for basic auth credentials over https","user":{"login":"judgej","id":395934,"avatar_url":"https://avatars.githubusercontent.com/u/395934?v=3","gravatar_id":"","url":"https://api.github.com/users/judgej","html_url":"https://github.com/judgej","followers_url":"https://api.github.com/users/judgej/followers","following_url":"https://api.github.com/users/judgej/following{/other_user}","gists_url":"https://api.github.com/users/judgej/gists{/gist_id}","starred_url":"https://api.github.com/users/judgej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/judgej/subscriptions","organizations_url":"https://api.github.com/users/judgej/orgs","repos_url":"https://api.github.com/users/judgej/repos","events_url":"https://api.github.com/users/judgej/events{/privacy}","received_events_url":"https://api.github.com/users/judgej/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/woothemes/woocommerce/labels/API","name":"API","color":"02d7e1"}],"state":"closed","locked":false,"assignee":{"login":"justinshreve","id":689165,"avatar_url":"https://avatars.githubusercontent.com/u/689165?v=3","gravatar_id":"","url":"https://api.github.com/users/justinshreve","html_url":"https://github.com/justinshreve","followers_url":"https://api.github.com/users/justinshreve/followers","following_url":"https://api.github.com/users/justinshreve/following{/other_user}","gists_url":"https://api.github.com/users/justinshreve/gists{/gist_id}","starred_url":"https://api.github.com/users/justinshreve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinshreve/subscriptions","organizations_url":"https://api.github.com/users/justinshreve/orgs","repos_url":"https://api.github.com/users/justinshreve/repos","events_url":"https://api.github.com/users/justinshreve/events{/privacy}","received_events_url":"https://api.github.com/users/justinshreve/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/woothemes/woocommerce/milestones/37","html_url":"https://github.com/woothemes/woocommerce/milestones/2.4%20Helpful%20Hedgehog","labels_url":"https://api.github.com/repos/woothemes/woocommerce/milestones/37/labels","id":865016,"number":37,"title":"2.4 Helpful Hedgehog","description":"","creator":{"login":"mikejolley","id":90977,"avatar_url":"https://avatars.githubusercontent.com/u/90977?v=3","gravatar_id":"","url":"https://api.github.com/users/mikejolley","html_url":"https://github.com/mikejolley","followers_url":"https://api.github.com/users/mikejolley/followers","following_url":"https://api.github.com/users/mikejolley/following{/other_user}","gists_url":"https://api.github.com/users/mikejolley/gists{/gist_id}","starred_url":"https://api.github.com/users/mikejolley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikejolley/subscriptions","organizations_url":"https://api.github.com/users/mikejolley/orgs","repos_url":"https://api.github.com/users/mikejolley/repos","events_url":"https://api.github.com/users/mikejolley/events{/privacy}","received_events_url":"https://api.github.com/users/mikejolley/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":101,"state":"open","created_at":"2014-11-13T14:35:46Z","updated_at":"2015-06-22T17:06:08Z","due_on":"2015-07-28T23:00:00Z","closed_at":null},"comments":24,"created_at":"2015-05-30T10:41:02Z","updated_at":"2015-06-22T17:06:08Z","closed_at":"2015-06-22T17:06:08Z","body":"I have been using the API from a PHP library and also directly from a browser. The “Consumer key is missing” error happens all too often, but the explanation of this being a \"server fault\" most of the time does not quite ring true. Here's why.\r\n\r\nI have tried accessing the API direct from a browser:\r\n\r\ne.g. https://ewxample.com/wc-api/v2/products\r\n\r\nThat gives me the “Consumer key is missing” error. But why isn't the browser asking me for the credentials? A few lines to return the right headers instead of an error, and it does, as detailed here:\r\n\r\nhttp://php.net/manual/en/features.http-auth.php\r\n\r\nCredentials can be entered, and the GET functions of the API can be accessed through the browser. That's great, and really helps to understand how the API works, as well as following the basic auth spec a little more closely.\r\n\r\nOn the same server I was having troubles accessing the same API over SSL from a PHP library and had to fall back to non-SSL oauth method. I had assumed the issue was the server config, but if a browser can get in this way, it can't be the server at fault, so I'm guessing there is something else going on here. I'm still investigating that.\r\n\r\nAnyway, tl;dr bit: accessing the API using SSL, which requires Basic Realm auth, should return the appropriate headers to prompt for the credentials, and not a JSON error message. I can provide a PR for this if the explanation is acceptable.\r\n\r\n"}}