Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting an authentication error when using basic auth with https url #113

Closed
mustafa01ali opened this issue Oct 13, 2012 · 6 comments
Closed
Assignees
Milestone

Comments

@mustafa01ali
Copy link

I am getting the following error when I try to do a GET request to an https URL

10-13 21:36:58.372: W/DefaultRequestDirector(9029): Authentication error: Unable to respond to any of these challenges: {}

I've set the basic auth using client.setBasicAuth(), tried with and without the AuthScope with no success.

@mustafa01ali
Copy link
Author

I am stuck because of this. Anybody there????

@ghost
Copy link

ghost commented Dec 6, 2012

Hey i am also stuck with this problem.Did you find any luck.??

Here comes my Code

AsyncHttpClient mAsyncHttpClient = new AsyncHttpClient();
mAsyncHttpClient.setBasicAuth("username", "password");

org.apache.http.client.HttpResponseException: Unauthorized
I/onFailure getCustomerOrder(7107): org.apache.http.client.HttpResponseException: Unauthorized
I/onFailure(7107): {"Message":"Authorization has been denied for this request."}
I/onFailure getCustomerOrder(7107): {"Message":"Authorization has been denied for this request."}

@gauravarora
Copy link

I have the exact same problem.

@dkwasnick
Copy link

I had the same problem. It seems that the server in these cases is not properly configured, so instead of replying to the GET/POST request by asking for credentials, it simply responds "not authorized" and shuts down. The solution is to pass the username/password in the request header itself.

String userpass = username+":"+password;
String encoded = new String(Base64.encode(userpass.getBytes(),Base64.NO_WRAP));
client.addHeader("Authorization", "Basic "+encoded);

@juanmacuevas
Copy link

I'm facing the same issue. Have you guys tried this?
http://dlinsin.blogspot.nl/2009/08/http-basic-authentication-with-android.html

@ghost ghost assigned smarek Oct 14, 2013
@smarek
Copy link
Member

smarek commented Oct 14, 2013

Closing as duplicate of #88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants