String requestAuthorizationTicket(String strLoginURL, String strUserName, String strPassword, String strChallenge)
    {

        if ((strLoginURL != null) &&
                (strUserName != null) &&
                (strPassword != null) &&
                (strChallenge != null))
        {

            String strAuthString = "Passport1.4 OrgVerb=GET,OrgURL=http%3A%2F%2Fmessenger%2Emsn%2Ecom,sign-in=" + strUserName + ",pwd=" + strPassword + "," + strChallenge;

            try
            {
                URL url = new URL(strLoginURL);
                String strLocation;
                String strAuthInfo;
                String strAuthTicket;


                log.debug(">>> Starting login");

                httpsConn = (HttpURLConnection) url.openConnection();
                httpsConn.setDoOutput(true);
                httpsConn.setRequestProperty("Authorization", strAuthString);
                httpsConn.setUseCaches(false);
                strLocation = httpsConn.getHeaderField(KEY_LOCATION);

                // Server is redirecting login ???
                if (strLocation != null)
                {
                    log.debug("<<< Server request redirecting login ");

                    url = new URL(strLocation);

                    log.debug(">>> Redirecting login to " + strLocation);

                    httpsConn = null;
                    httpsConn = (HttpURLConnection) url.openConnection();
                    httpsConn.setDoOutput(true);
                    httpsConn.setRequestProperty("Authorization", strAuthString);
                    httpsConn.setUseCaches(false);
                }

                strAuthInfo = httpsConn.getHeaderField(KEY_AUTHENTICATION_INFO);
                httpsConn = null;

                if (getField(DASTATUS, strAuthInfo).compareTo(SUCCESS) != 0)
                {
                    return null;
                }

                strAuthTicket = getField(TICKET, strAuthInfo);

                if (strAuthTicket != null)
                {
                    strAuthTicket = strAuthTicket.substring(1, strAuthTicket.length() - 1);
                }

                return strAuthTicket;

            }
            catch (UnknownHostException ue)
            {
                return null;
            }
            catch (IOException e)
            {
                return null;
            }
        }

        return null;
    }