Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

JT Keller
JT Keller
12,731 Points

Digest Authentication for Android

Does anyone have some example code or some great links to docs/info dealing with digest authentication for Android?

It looks as though HttpURLConnection doesn't support digest and/or is currently bugged. This is how I've been establishing connections to my web services so far and I'm a little thrown by some of the Apache HTTP workarounds that I've found. Any help would be appreciated! Thanks.

2 Answers

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

It's been a while, but I used the Authenticator class as shown in this StackOverflow answer: http://stackoverflow.com/a/9484808/475217

JT Keller
JT Keller
12,731 Points

Thanks for the reply Ben. There seems to be a bug with that class and for some reason anything other than basic authentication doesn't work, even though it should.

JT Keller
JT Keller
12,731 Points

For anyone else interested in this...I haven't had time to test the code but this thread seems to have a few solutions: https://code.google.com/p/android/issues/detail?id=9579