Dear  Geir,

    Thank you for your reply. Your solution for OC4J was not working with
Tomcat. I managed to make it work after getting ideas from your last reply
which was using HttpServletRequest. Below is the working solution, which may
help other readers.

        // acquire the active HTTP Request
        HttpServletRequest req =
            (HttpServletRequest)
inMesasgeContext.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);

        // Acquiring Authorization Header from servlet request
        String             auth = req.getHeader("Authorization");

        auth = auth.substring(auth.indexOf(" "));

        // Decoding the authorization header...
        String decoded = new String(Base64.decode(auth));

        // decoded now contains username:password in plain text.
        int i = decoded.indexOf(":");

        // so we take the username from it ( everything until the ':' )
        String username = decoded.substring(0, i);

        // and the password
        String pwd = decoded.substring(i + 1, decoded.length());
        
       // Printing it for confirmation.
        System.out.println(username + "   " + pwd);

Once again thank you for your help.

Cheers
Asif


-- 
View this message in context: 
http://www.nabble.com/AXIS2-1.1.1-problem-with-BASIC-AUTH-tf3559184.html#a10163886
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to