log.debug("Enter: HTTPAuthHandler::invoke");
/* Process the Basic Auth stuff in the headers */
/***********************************************/
String tmp = (String)msgContext.getProperty(HTTPConstants.HEADER_AUTHORIZATION);
if ( tmp != null ) tmp = tmp.trim();
if ( tmp != null && tmp.startsWith("Basic ") ) {
String user=null ;
int i ;
tmp = new String( Base64.decode( tmp.substring(6) ) );
i = tmp.indexOf( ':" );
if ( i == -1 ) user = tmp ;
else user = tmp.substring( 0, i);
msgContext.setUsername( user );
log.debug( Messages.getMessage("httpUser00", user) );
if ( i != -1 ) {
String pwd = tmp.substring(i+1);
if ( pwd != null && pwd.equals("") ) pwd = null ;
if ( pwd != null ) {
msgContext.setPassword( pwd );
log.debug( Messages.getMessage("httpPassword00", pwd) );
}
}
}
log.debug("Exit: HTTPAuthHandler::invoke");