コード例 #1
0
        private void Login_Click(object sender, EventArgs e)
        {
            // bp.ProcessLogIn();
            // 1202776055759 : 5215137aefbadba6e4be95e70ee24cf4
            // 1202776155043 : fa1ec0c8421a99d3aff45ecd39725e86
            // 1203462160522 : 9040daff8f107aaa84e6f89dd496b3f6
            // bp.ProcessLogIn();

            string nonceValue = "1203462160522";
            string pass1      = bp.EncryptPassword(nonceValue);
            string pass2      = OCIUtilClient.ComputeMessageDigest("admin", nonceValue);

            // get/send the LoginRequest Message  to login to the platform
            string msg = bp.GetLoginMsg(pass2);

            OCIUtilClient.SendOCIMsg(msg);
        }
コード例 #2
0
ファイル: BworksProvisioner.cs プロジェクト: nuevollc/Nuevo
        public bool ProcessLogIn()
        {
            try
            {
                // tcpmgr = new TCPManager();
                //Send the auth message
                String request = GetAuthMsg();

                bp = new BWProvisioningServiceService();
                string xmlResponse = bp.processOCIMessage(request);
                //string xmlResponse = bp.sendMsg(request);

                //String xmlResponse = OCIUtilClient.SendOCIMsg(request);
                System.Console.WriteLine("Results:" + xmlResponse);

                if (xmlResponse != null)
                {
                    int indx1 = xmlResponse.IndexOf("AuthenticationResponse");
                    if (indx1 < 0)
                    {
                        System.Console.WriteLine("RequestAuthentication" + " Invalid: " + xmlResponse);
                        return(false);
                    }

                    indx1 = xmlResponse.IndexOf("<nonce>");
                    int indx2 = xmlResponse.IndexOf("</nonce>");
                    if (indx2 <= indx1)
                    {
                        System.Console.WriteLine("InvalidAuthenticationResponse: " + xmlResponse);
                        return(false);
                    }

                    indx1 += "<nonce>".Length;
                    String nonceValue = xmlResponse.Substring(indx1, indx2 - indx1);

                    // hash the password
                    // MD5 Encrypted Password Calculation
                    //String pass = EncryptPassword( nonceValue );
                    String pass = OCIUtilClient.ComputeMessageDigest(this.pass, nonceValue);

                    // submit the login request message
                    String LoginRequest = this.GetLoginMsg(pass);
                    //xmlResponse = bp.sendMsg(request);

                    OCIUtilClient.SendOCIMsg(LoginRequest);


                    if (xmlResponse != null)
                    {
                        indx1 = xmlResponse.IndexOf("LoginResponse");
                        if (indx1 < 0)
                        {
                            System.Console.WriteLine("LoginRequest" + " command failed");
                            return(false);
                        }
                        System.Console.WriteLine("LoginRequest" + " command successful\n");
                    }
                    else
                    {
                        System.Console.WriteLine("LoginRequest" + " command unsuccessful\n");
                        return(false);
                    }
                }
            }
            catch (System.Exception ex)
            {
                System.Console.WriteLine("ECaught:" + ex.Message + "  StackTrace: " + ex.StackTrace);
            }

            return(true);
        }//ProcessLogIn