Fixing Java URL Authentication 401 Errors

I came across an issue the other day where my URL with inline authentication tokens was giving me a 401 Unauthorized error.  For the unfamiliar, URL authentication isn’t very heavily used, but it works like this:

https://username:password@protected.domain.example/resource

That username:password bit is known in Java as the User Info string, and Java handles it differently than web browsers do.

Continue reading “Fixing Java URL Authentication 401 Errors”