There are numerous answer to this (one, two, three) but they all use obsolete methods. For Java 1.7 and later what is the best way to request a resource over http when credentials need to be supplied for Basic, Digest, NTLM, and/or Windows Identity?
Using an Apache library for this is fine.
I know this is a repeat question, but the existing answer all appear to be using obsolete calls.
Update: This is for a library we have where a user can pass to us any URL and say it is any of the different authentication systems. This library is added to different applications by our users. So, it could be any service, used in any application. It could be web, it could be REST. It could be under Apache, WebLogic, WebSphere, or anything else.