{"action":"created","issue":{"url":"https://api.github.com/repos/cloudant/java-cloudant/issues/229","repository_url":"https://api.github.com/repos/cloudant/java-cloudant","labels_url":"https://api.github.com/repos/cloudant/java-cloudant/issues/229/labels{/name}","comments_url":"https://api.github.com/repos/cloudant/java-cloudant/issues/229/comments","events_url":"https://api.github.com/repos/cloudant/java-cloudant/issues/229/events","html_url":"https://github.com/cloudant/java-cloudant/issues/229","id":139920817,"number":229,"title":"Cloudant Java Client failing with '400 Bad request' error","user":{"login":"jponth","id":17460408,"avatar_url":"https://avatars.githubusercontent.com/u/17460408?v=3","gravatar_id":"","url":"https://api.github.com/users/jponth","html_url":"https://github.com/jponth","followers_url":"https://api.github.com/users/jponth/followers","following_url":"https://api.github.com/users/jponth/following{/other_user}","gists_url":"https://api.github.com/users/jponth/gists{/gist_id}","starred_url":"https://api.github.com/users/jponth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jponth/subscriptions","organizations_url":"https://api.github.com/users/jponth/orgs","repos_url":"https://api.github.com/users/jponth/repos","events_url":"https://api.github.com/users/jponth/events{/privacy}","received_events_url":"https://api.github.com/users/jponth/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-10T15:24:36Z","updated_at":"2016-03-11T02:00:43Z","closed_at":null,"body":"Description of issue:\r\nIn order to connect to Cloudant Local, had to put in username:password@ in the url and also basic authenticator.If only one of the above is provided, access to cloudant db fails with  '400 Bad request' error. See code below\r\n\r\n- CloudantClient (java-cloudant) version(s): 2.3\r\n- Java version: 1.8, redhat linux\r\n- If you're using the optional okhttp dependency: no\r\n\r\nCode sample:\r\n1. What didn't work:\r\n\t\t\tCloudantClient client =  ClientBuilder.url(new URL(\"ip.address:80\"))\r\n\t\t\t              .username(\"username\")\r\n\t\t\t              .password(\"password\")\r\n\t\t\t              .build();\r\n2. What worked:\r\nNote the username:password in the url.\r\n\t\t\tBasicAuthInterceptor basicAuthInterceptor = new BasicAuthInterceptor(\"username\" + \":\" + \"password\");\r\n\t\t\tCloudantClient client =  ClientBuilder.url(new URL(\"username:password@ip.address:80\"))\r\n\t\t\t              .username(\"username\")\r\n\t\t\t              .password(\"password\")\r\n\t\t\t              .interceptors(basicAuthInterceptor)\r\n\t\t\t              .build();"},"comment":{"url":"https://api.github.com/repos/cloudant/java-cloudant/issues/comments/195141921","html_url":"https://github.com/cloudant/java-cloudant/issues/229#issuecomment-195141921","issue_url":"https://api.github.com/repos/cloudant/java-cloudant/issues/229","id":195141921,"user":{"login":"jponth","id":17460408,"avatar_url":"https://avatars.githubusercontent.com/u/17460408?v=3","gravatar_id":"","url":"https://api.github.com/users/jponth","html_url":"https://github.com/jponth","followers_url":"https://api.github.com/users/jponth/followers","following_url":"https://api.github.com/users/jponth/following{/other_user}","gists_url":"https://api.github.com/users/jponth/gists{/gist_id}","starred_url":"https://api.github.com/users/jponth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jponth/subscriptions","organizations_url":"https://api.github.com/users/jponth/orgs","repos_url":"https://api.github.com/users/jponth/repos","events_url":"https://api.github.com/users/jponth/events{/privacy}","received_events_url":"https://api.github.com/users/jponth/received_events","type":"User","site_admin":false},"created_at":"2016-03-11T02:00:43Z","updated_at":"2016-03-11T02:00:43Z","body":"Using Cloudant Local version 1.0.0.3. Yes, require authorized user.\n\nCloudant-client 2.3, for Java\n\nThanks\n\n> On Mar 10, 2016, at 11:48 AM, Rhys Short <notifications@github.com> wrote:\n> \n> What version of Cloudant Local are you using? Also is it configured to require authorised user?\n> \n> —\n> Reply to this email directly or view it on GitHub.\n> \n"}}