示例#1
0
        public STC_MSG m_authentifier(STC_MSG msg)
        {
            this.msg = msg;
            this.msg = this.cam.dispatching(this.msg);

            return(this.msg);
        }
示例#2
0
 private void M_auhentifier(STC_MSG msg)
 {
     this.msg             = msg;
     this.msg.op_name     = "authentifier";
     this.msg.app_name    = "Middleware";
     this.msg.app_token   = "apptoken";
     this.msg.app_version = "2.0";
     this.msg.op_info     = "Demande de service de l'application 1 de version 2.0";
     this.msg             = this.client.Login(this.msg);
 }
示例#3
0
        public STC_MSG getRows(STC_MSG msg)
        {
            this.msg              = msg;
            this.rq_sql           = (string)msg.data[0];
            this.cmd.CommandText  = this.rq_sql;
            this.da.SelectCommand = this.cmd;
            this.da.Fill(this.ds, (string)msg.data[1]);
            this.msg.data = new object[1] {
                (object)this.ds.Tables[0]
            };

            return(this.msg);
        }
示例#4
0
        public CAD()
        {
            this.msg = new STC_MSG();
            this.cmd = new SqlCommand();
            this.cnx = new SqlConnection();
            this.da  = new SqlDataAdapter();
            this.ds  = new DataSet();

            this.cnx_string           = @"Data Source=ROBIN\Robin;Initial Catalog=WCF2;User ID=user;Password=root";
            this.cnx.ConnectionString = this.cnx_string;
            this.cmd.CommandType      = CommandType.Text;
            this.cmd.Connection       = this.cnx;
        }
示例#5
0
        public STC_MSG selectByLoginPsw(STC_MSG msg)
        {
            this.msg = msg;
            this.log = msg.user_login;
            this.psw = msg.user_psw;

            rq_sql = "SELECT id, nom, prenom FROM tb_personne WHERE (login = '******') AND (psw = '" + psw + "');";

            this.msg.data = new object[1] {
                (object)rq_sql
            };

            return(this.msg);
        }
示例#6
0
 public STC_MSG dispatching(STC_MSG msg)
 {
     this.msg = msg;
     if (msg.app_name == "Appli1")
     {
         if (msg.app_version == "10")
         {
             if (msg.op_name == "authentifier")
             {
                 this.exec = new M3_CTRLWF.CTRLWF_Auth_V1();
                 this.msg  = this.exec.exec(this.msg);
             }
         }
     }
     return(this.msg);
 }
示例#7
0
 public STC_MSG m_doc_authentifier(STC_MSG msg)
 {
     /*Construction de la documentation pour le service
      *  this.msg.app_name = "";
      *  this.msg.app_token = "";
      *  this.msg.app_version = "";
      *  this.msg.data = null;
      *  this.msg.op_info = "............................................";
      *  this.msg.op_name = "";
      *  this.msg.op_statut = true;
      *  this.msg.user_login="";
      *  this.msg.user_psw="";
      *  this.msg.user_token="";
      *
      */
     return(this.msg);
 }
示例#8
0
        private void M_Decrypter(AuthProxy.STC_MSG msg, object[] file)
        {
            STC_MSG msgData = new STC_MSG
            {
                op_name     = "decrypter",
                app_name    = "Middleware",
                app_token   = "apptoken",
                app_version = "2.0",
                op_info     = "Demande de service de l'application 1 de version 2.0",
                data        = file
            };

            DisplayResult(msgData.data[0].ToString());
            DisplayResult("en cours de traitement...");

            try
            {
                msgData = this.decryptClient.DecryptFiles(msgData);
            }
            catch (Exception e)
            {
                throw new Exception("Middleware error " + e.ToString());
            }

            if (msgData.data.Length > 2)
            {
                DisplayResult(msgData.data[0].ToString() + ": Traitement terminé !");

                /*
                 * Result r = new Result()
                 * {
                 *      name = msgData.data[0].ToString(),
                 *      text = msgData.data[1].ToString(),
                 *      key = msgData.data[2].ToString()
                 * };
                 *
                 * DisplayResult("Filename = " + r.name + Environment.NewLine + "Text = " + r.text + Environment.NewLine + "Key = " + r.key);
                 */
            }
        }
示例#9
0
        public STC_MSG exec(STC_MSG msg)
        {
            // L'orchestration et la gestion transactionelle doivent être mise en oeuvre ici.
            int count;

            this.msg = msg;
            count    = -1;

            this.sql      = new CMPGE_people();
            this.msg      = this.sql.selectByLoginPsw(this.msg);
            this.msg.data = new object[2] {
                this.msg.data[0], (object)"resultat"
            };
            this.msg = this.cad.getRows(this.msg);
            count    = ((System.Data.DataTable) this.msg.data[0]).Rows.Count;

            if (count == 1)
            {
                this.msg.op_info    = "succes";
                this.msg.op_statut  = true;
                this.msg.user_token = "12345";
            }
            else
            {
                this.msg.op_info   = "fail";
                this.msg.op_statut = false;
            }

            this.msg.app_name    = null;
            this.msg.app_token   = null;
            this.msg.app_version = null;
            this.msg.data        = null;
            this.msg.op_name     = null;
            this.msg.user_login  = null;
            this.msg.user_psw    = null;

            return(this.msg);
        }
示例#10
0
 public PCS_personne()
 {
     this.msg = new STC_MSG();
     this.cam = new CAM.CL_CAM();
 }
示例#11
0
 public CTRLWF_Auth_V1()
 {
     this.msg = new STC_MSG();
     this.cad = new M4_CAD.CAD();
 }
示例#12
0
        public STC_MSG m_service(STC_MSG msg)
        {
            int i;

            Console.ForegroundColor = ConsoleColor.Blue;

            OperationContext              ctx  = OperationContext.Current;
            MessageProperties             msgP = ctx.IncomingMessageProperties;
            RemoteEndpointMessageProperty remP = msgP[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty;
            ServiceSecurityContext        ssc  = ServiceSecurityContext.Current;

            Console.WriteLine("Demande entrante : " + "<" + ssc.WindowsIdentity.Name + ">" + ssc.WindowsIdentity.User);
            Console.WriteLine("Adresse cliente : " + remP.Address);
            Console.WriteLine("Port client : " + remP.Port);
            Console.WriteLine("Détail du message ->");
            Console.WriteLine("Application cliente : " + msg.app_name);
            Console.WriteLine("Application token : " + msg.app_token);
            Console.WriteLine("Application version : " + msg.app_version);
            Console.WriteLine("Opération info : " + msg.op_info);
            Console.WriteLine("Opération nom : " + msg.op_name);
            Console.WriteLine("Opération statut : " + msg.op_statut);
            Console.WriteLine("Utilisteur login : "******"Utilisteur password : "******"Utilisteur token : " + msg.user_token);

            if (msg.data != null)
            {
                i = msg.data.Length;
                Console.WriteLine("Le message contient {0} donnée(s) spécifique(s)", i + 1);
            }
            else
            {
                Console.WriteLine("Le message ne contient pas de données spécifiques");
            }
            Console.WriteLine("");
            if (msg.app_token == "12345")
            {
                Console.WriteLine("App Token:" + msg.app_token);
                if (msg.op_name == "authentifier")
                {
                    Console.WriteLine("Operation Name:" + msg.op_name);
                    this.msg     = msg;
                    this.service = new PCS_personne();
                    this.msg     = ((PCS_personne)this.service).m_authentifier(this.msg);
                }
            }
            else
            {
                this.msg.app_name    = "";
                this.msg.app_token   = "";
                this.msg.app_version = "";
                this.msg.data        = null;
                this.msg.op_info     = "Cette application n'est pas prise en charge par la plateforme.";
                this.msg.op_name     = "";
                this.msg.op_statut   = false;
                this.msg.user_login  = "";
                this.msg.user_psw    = "";
                this.msg.user_token  = "";
            }
            return(this.msg);
        }
示例#13
0
 public STC_MSG actionRows(STC_MSG msg)
 {
     return(this.msg);
 }
示例#14
0
 public MainWindow()
 {
     InitializeComponent();
     this.msg = new STC_MSG();
     client   = new AuthClient("authTcp");
 }
示例#15
0
 public CL_CAM()
 {
     this.msg = new STC_MSG();
 }
示例#16
0
 public SVC()
 {
     this.msg     = new STC_MSG();
     this.service = null;
 }
示例#17
0
 public CMPGE_people()
 {
     this.msg = new STC_MSG();
 }