Before you think I should post it on an other forum - this is Windows OS related question, not programming.
I'm creating intranet website which needs user to authorize through Kerberos. After days of research I think that using PHP for this is not really best-way-to-do-it and I need to find other solution. So I got this idea, which works really good: I can use my knowledge in C# to use .NET Framework to do work for me. So I wrote (for now) little application, which uses Kerberos to check user credentials. I run application from PHP to check its return code something like:
myapplication.exe user_name password1!
(in near future it will get more information through command line)
It returns code based on authorization check, so my PHP application knows if it was success or not. Kerberos authorization is encrypted (that was super-easy with .NET), so I have "two birds with one stone". Of course, whole process is more complicated so I don't need to use it every single time, when user logins, but that's not the point here.
I'm asking questions, because I may learn something useful and I want to be sure:
Is this approach really secure? Does anybody can get password which I'm passing to command line? Can it be logged somewhere? And if yes - can I prevent this? If this is not secure - can I pass credentials more safely?
It's really just one question "Is this secure?" but I want to give you some idea what I'm asking for. I don't want to go too far with this, unless I'm sure it's good idea. Also, everything is working perfectly so far.
I'm using Apache server on Windows Server with MySQL database (probably will change to MSSQL Express).
[EDIT] I should point out that I'm using exec() command in PHP. I'm asking if you can somehow get communication between Apache service starting/running myapplication.exe, because password is passed one-time-only there as plain text.