BZ-1012882 - Deploy of springapp war causes continuous auth problems (er...

...ror 401 - validation fails) in business central

Extended authentication to accept SecurityContext object as part of authenticate method to do not rely on PolicyContext to get hold of HttpServletRequest for BASIC authentication. PolicyContext is JACC specific and thus not always available for instance on servlet containers e.g. Tomcat. 
Moreover there is rather serious bug in JBoss AS7.1.1 and EAP 6.1 that removes HttpServletRequest handler from PolicyContext on application undeployment (any application) making BASIC auth failing due to missing HttpServletRequest in PolicyContext.

Some details about this bug can be found here: https://community.jboss.org/message/822388?tstart=0&_sscc=t