diff --git a/src/main/java/com/github/baloise/rocketchatrestclient/RocketChatClientCallBuilder.java b/src/main/java/com/github/baloise/rocketchatrestclient/RocketChatClientCallBuilder.java index 3df5c02..516ae28 100644 --- a/src/main/java/com/github/baloise/rocketchatrestclient/RocketChatClientCallBuilder.java +++ b/src/main/java/com/github/baloise/rocketchatrestclient/RocketChatClientCallBuilder.java @@ -119,13 +119,13 @@ private void login() throws IOException { HttpResponse loginResult; try { - loginResult = Unirest.post(serverUrl + "v1/login").field("username", user).field("password", password).asJson(); + loginResult = Unirest.post(serverUrl + "v1/login").field("user", user).field("password", password).asJson(); } catch (UnirestException e) { throw new IOException(e); } if (loginResult.getStatus() == 401) - throw new IOException("The username and password provided are incorrect."); + throw new IOException("The user and password provided are incorrect."); if (loginResult.getStatus() != 200)