{"action":"opened","issue":{"url":"https://api.github.com/repos/fguillot/kanboard/issues/1421","labels_url":"https://api.github.com/repos/fguillot/kanboard/issues/1421/labels{/name}","comments_url":"https://api.github.com/repos/fguillot/kanboard/issues/1421/comments","events_url":"https://api.github.com/repos/fguillot/kanboard/issues/1421/events","html_url":"https://github.com/fguillot/kanboard/issues/1421","id":113695693,"number":1421,"title":"API call using Java always returns 401 Unauthorized","user":{"login":"BaydushLC","id":10816828,"avatar_url":"https://avatars.githubusercontent.com/u/10816828?v=3","gravatar_id":"","url":"https://api.github.com/users/BaydushLC","html_url":"https://github.com/BaydushLC","followers_url":"https://api.github.com/users/BaydushLC/followers","following_url":"https://api.github.com/users/BaydushLC/following{/other_user}","gists_url":"https://api.github.com/users/BaydushLC/gists{/gist_id}","starred_url":"https://api.github.com/users/BaydushLC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BaydushLC/subscriptions","organizations_url":"https://api.github.com/users/BaydushLC/orgs","repos_url":"https://api.github.com/users/BaydushLC/repos","events_url":"https://api.github.com/users/BaydushLC/events{/privacy}","received_events_url":"https://api.github.com/users/BaydushLC/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-27T21:38:37Z","updated_at":"2015-10-27T21:38:37Z","closed_at":null,"body":"Any calls to API using Javaas in sample form web site fails.  Sample below run against demo site returns 401 Unauthorized.\r\n\r\n        RestTemplate restTemplate = new RestTemplate();\r\n\r\n        String url = \"http://demo.kanboard.net/jsonrpc.php\";\r\n        String requestJson = \"{\\\"jsonrpc\\\": \\\"2.0\\\", \\\"method\\\": \\\"getVersion\\\", \\\"id\\\": 1661138292}\";\r\n        String user = \"demo\";\r\n        String apiToken = \"demo123\";\r\n\r\n        // encode api token\r\n        byte[] xApiAuthTokenBytes = String.join(\":\", user, apiToken).getBytes(\"utf-8\");\r\n        String xApiAuthToken = Base64.getEncoder().encodeToString(xApiAuthTokenBytes);\r\n\r\n        // consume request\r\n        HttpHeaders headers = new HttpHeaders();\r\n        headers.add(\"X-API-Auth\", xApiAuthToken);\r\n        headers.setContentType(MediaType.APPLICATION_JSON);\r\n        HttpEntity<String> entity = new HttpEntity<String>(requestJson, headers);\r\n        try\r\n        {\r\n        \tString answer = restTemplate.postForObject(url, entity, String.class);\r\n        \tSystem.out.println(answer);\r\n        }\r\n        catch( Exception e )\r\n        {\r\n        \tSystem.out.println( e.getMessage() );\r\n        }\r\n"}}