mttkay / ignition

Kick-starts Android application development.
1.28k stars 290 forks source link

Basic Authentication for Image URL #10

Open saadfarooq opened 12 years ago

saadfarooq commented 12 years ago

I don't know if you would want to consider this or not but basic authentication capabilities for the RemoteImageLoader could be handy in some cases.

mttkay commented 12 years ago

Good point! Do you have a URL to test against, one that requires e.g. a BasicAuth handshake or something?

saadfarooq commented 12 years ago

I could give you one but then I'd have to kill you...

No seriously. I'll have to ask someone cause they're pretty secretive but I did the following on line 88 of RemoteImageLoaderJob.java

   HttpURLConnection connection = (HttpURLConnection) url.openConnection();

   connection.setRequestProperty("Authorization", "Basic "+ "bm9xd3RvcxU6dHgpa*w=");

No surprise there. All you need is to have a way to pass this down somehow. I can test it for you until I get approval.