Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Digest Authentication #782

Open
Open
@gameplanet

Description

@gameplanet

Hi there, I'm following your digest Authentication Sample to try access an API that has this kind of security, the problem is that it is always returning me Authentication error: basic authorization challenge expected, but not found.

Basically my code is something like this:

    public static void get(String url, RequestParams params, AsyncHttpResponseHandler handler){
        AsyncHttpClient client = new AsyncHttpClient();
        client.setAuthenticationPreemptive(true);
        client.setCredentials(AuthScope.ANY,new UsernamePasswordCredentials("user","pass."));
        client.get(getAbsoluteUrl(url), params, handler);

    } 

Also I downloaded your project from here, and tried to run your digest auth example (DigestAuthSample.java) and it always return Return Status Code 401
org.apache.http.client.HttpResponseException: Unauthorized at ..... (it goes on)
and it continues.

What's the correct way to successfully connect to a digest auth protected API?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions