Skip to content

impossible to access a public resource without being logged. #6

Teovald opened this Issue Dec 4, 2012 · 1 comment

2 participants

Teovald commented Dec 4, 2012

Trying to fetch a public resource fails with Error 401 : Unauthorized

ApiWrapper wrapper = new ApiWrapper(client_id, client_secret, null,null);
HttpResponse response = wrapper.get("/tracks").with("CLIENT_ID", client_id, "order", "hotness"));

It works only if wrapper.login is called beforehand, which is not always possible and is not supposed to be necessary. It is problematic if you want to let your user explore the app a little bit without forcing him to authenticate himself as the first step.

As a workaround, making the call myself works perfectly (but it defeats the interest of having a wrapper):

HttpGet request = new HttpGet("");
            HttpClient client = new DefaultHttpClient();
            response = client.execute(request);
@jberkel jberkel added a commit that closed this issue Jan 10, 2013
@jberkel jberkel Allow requests without login
Closes #6
@jberkel jberkel closed this in 8995c61 Jan 10, 2013
Teovald commented Jan 12, 2013

Thanks for the update, much appreciated !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.