Re: SSPI/NTLM between native code and managed code fails for Windows 2
- From: "Joe Kaplan" <joseph.e.kaplan@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 25 Nov 2008 10:37:29 -0600
I'm not sure what the problem is, but given that you are using a C# app here, did you consider using NegotiateStream directly on top of TcpClient or something like that in your managed code so that you could use Microsoft's SSPI/Negotiate wrapper instead of your own?
This doesn't address any potential issues in your native server, but might help and give you an opportunity to simplify your code base.
Joe K.
--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
"jenny" <jenny@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:FC2425C5-A16C-4F1F-95B9-42C5B091C4F5@xxxxxxxxxxxxxxxx
I have an appliction that uses C++/CLI code for the client side of an NTLM
exchange, and native C++ code for the server side.
The server and client code run on different machines and use TCP/IP to throw
the "token" back and forth until authentication occurs.
This works with no problems under Windows 2003. And has worked for about a
year for us with no problems. However, under Windows 2008, the authentication
has stopped working *only* when C++/CLI code is interacting with native code.
Doesn't matter which machine is the target or which machine is the client.
The error code I am getting back from the server is: 0x80090308 (The token
supplied to the function is invalid). Also, AcceptSecurityContext(...)
returns: ASC_RET_THIRD_LEG_FAILED in the contextattributes.
The strange thing is, NTLM authentication still works if both the apps are
native (i.e. pure C++).
Actually, the be more accurate: a C# app calls into a C++/CLI native wrapper
library, that performs the NTLM authentication. The C# app is an MMC app.
NTLM
C# --> C++/CLI <------> Native C++ (Does not work)
NTLM
native C++ <-------> native C++ (works)
Under Windows 2003, there has never been a problem for over a year.
Question:
Can anyone think of a reason why this could be? I am totally mystified. Is
there anyway to emit more information about why the authentication failed.
Could managed code cause this kind of problem?
Thanks,
Jenny.
--
C/C++ Software Engineer
.
- Follow-Ups:
- References:
- Prev by Date: Re: Adding a publisher to the trusted publishers w/o UI
- Next by Date: Authenticate in a windows domain using a CAP only with biometric d
- Previous by thread: SSPI/NTLM between native code and managed code fails for Windows 2
- Next by thread: Re: SSPI/NTLM between native code and managed code fails for Windo
- Index(es):
Relevant Pages
|