{"action":"created","issue":{"url":"https://api.github.com/repos/osiam/connector4java/issues/117","labels_url":"https://api.github.com/repos/osiam/connector4java/issues/117/labels{/name}","comments_url":"https://api.github.com/repos/osiam/connector4java/issues/117/comments","events_url":"https://api.github.com/repos/osiam/connector4java/issues/117/events","html_url":"https://github.com/osiam/connector4java/issues/117","id":48448461,"number":117,"title":"ConnectionInitializationException is thrown on bad credentials","user":{"login":"smancke","id":4291379,"avatar_url":"https://avatars.githubusercontent.com/u/4291379?v=3","gravatar_id":"","url":"https://api.github.com/users/smancke","html_url":"https://github.com/smancke","followers_url":"https://api.github.com/users/smancke/followers","following_url":"https://api.github.com/users/smancke/following{/other_user}","gists_url":"https://api.github.com/users/smancke/gists{/gist_id}","starred_url":"https://api.github.com/users/smancke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smancke/subscriptions","organizations_url":"https://api.github.com/users/smancke/orgs","repos_url":"https://api.github.com/users/smancke/repos","events_url":"https://api.github.com/users/smancke/events{/privacy}","received_events_url":"https://api.github.com/users/smancke/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/osiam/connector4java/labels/change","name":"change","color":"bfdadc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2014-11-11T23:12:09Z","updated_at":"2015-09-25T19:12:39Z","closed_at":null,"body":"When I use the retrieveAccessToken with the ResourceOwnerPasswordCredentials Grant type,\r\nthen I can't see, if the credentials are wrong, or if I have a technical error (e.g. osiam server not found). Always ConnectionInitializationException is thrown. I would expect something like a LoginException."},"comment":{"url":"https://api.github.com/repos/osiam/connector4java/issues/comments/143326044","html_url":"https://github.com/osiam/connector4java/issues/117#issuecomment-143326044","issue_url":"https://api.github.com/repos/osiam/connector4java/issues/117","id":143326044,"user":{"login":"dacrome","id":1593279,"avatar_url":"https://avatars.githubusercontent.com/u/1593279?v=3","gravatar_id":"","url":"https://api.github.com/users/dacrome","html_url":"https://github.com/dacrome","followers_url":"https://api.github.com/users/dacrome/followers","following_url":"https://api.github.com/users/dacrome/following{/other_user}","gists_url":"https://api.github.com/users/dacrome/gists{/gist_id}","starred_url":"https://api.github.com/users/dacrome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dacrome/subscriptions","organizations_url":"https://api.github.com/users/dacrome/orgs","repos_url":"https://api.github.com/users/dacrome/repos","events_url":"https://api.github.com/users/dacrome/events{/privacy}","received_events_url":"https://api.github.com/users/dacrome/received_events","type":"User","site_admin":false},"created_at":"2015-09-25T19:12:39Z","updated_at":"2015-09-25T19:12:39Z","body":"When the `auth-server` [returns `400/Bad Request` a `ConnectionInitializationException` is thrown](https://github.com/osiam/connector4java/blob/master/src/main/java/org/osiam/client/AuthService.java#L296). I expected something like `BadRequestException`. But I also expected a `401/Unauthorized` from the `auth-server`s `/oauth/token` (internal spring security) endpoint if the credentials are wrong. The only way to find out if the credentials are wrong is to check the response body against `Bad Credentials`. How should we handle this?"}}