HTTP 400 Bad Request while Authenticating