java - How do I extract the username and password out of a URL in a filter? -


i've created basicauthfilter , has signature:

@override public void dofilter(servletrequest request,                      servletresponse response,                      filterchain chain) throws ioexception, servletexception  

this working if calls filter authorization header set right way. but, if on chrome or firefox visits url this:

http://username:password@localhost:8888 

the browsers not populating authorization header information (which surprised me). looked @ information sent chrome , username , password in request url else.

i can't figure out how extract information url. i've tried lot of getters on httpservletrequest, haven't found gives me username , password.

note: yes, know insecure, it's convenient use when you're trying test system.

my coworker found this thread implies isn't possible in modern browsers. refuse send username:password part of url on wire security reasons.


Comments

Popular posts from this blog

javascript - CasperJS/PhantomJS failing SSL handshakes on some sites even with --ssl-protocol=any -

codeigniter - Fatal error: Call to undefined function lang() in CI Merchant using CardSave -

python - Received unregistered task using Celery with Django -