(NegotiateStream) The server has rejected the client credentials
-
I've followed the following tutorial: http://msdn.microsoft.com/en-us/library/system.net.security.negotiatestream%28VS.80%29.aspx[^] and have implemented a server and client application. :) When I use the client to connect to the server on the same machine (i.e. the IP is 127.0.0.1) it makes a secure connection. :) When I use the client on my XP machine to connect to the server on my Vista machine then the line:
authStream.EndAuthenticateAsServer(ar);
fails with the exception I pasted into the subject of this post. :( What I want to do is allow any client on any machine over the internet or LAN to connect to my server on port 9000 over an encrypted connection. I would be happy if I could allow the client to specify a username and password - but I don't know how to implement that functionality. details on the exception: $exception
- $exception {"The server has rejected the client credentials."} System.Exception {System.Security.Authentication.InvalidCredentialException}
-
\[System.Security.Authentication.InvalidCredentialException\] {"The server has rejected the client credentials."} System.Security.Authentication.InvalidCredentialException
-
Data {System.Collections.ListDictionaryInternal} System.Collections.IDictionary {System.Collections.ListDictionaryInternal} HelpLink null string
-
InnerException {"The logon attempt failed"} System.Exception {System.ComponentModel.Win32Exception} Message "The server has rejected the client credentials." string Source "System" string StackTrace " at System.Net.Security.NegoState.EndProcessAuthentication(IAsyncResult result)\\r\\n at System.Net.Security.NegotiateStream.EndAuthenticateAsServer(IAsyncResult asyncResult)\\r\\n at RemoteDiagnostics.Server.class\_RDServer.EndAuthenticateCallback(IAsyncResult ar) in C:\\\\Users\\\\Nuclear\\\\Documents\\\\Visual Studio 2008\\\\Projects\\\\RemoteDiagnostics\\\\RemoteDiagnostics\\\\Server\\\\class\_RDServer.cs:line 280" string
-
TargetSite {Void EndProcessAuthentication(System.IAsyncResult)} System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}
authStream
- authStream {System.Net.Security.NegotiateStream} System.Net.Security.NegotiateStream
-
base {System.Net.Security.NegotiateStream} System.
-
-
I've followed the following tutorial: http://msdn.microsoft.com/en-us/library/system.net.security.negotiatestream%28VS.80%29.aspx[^] and have implemented a server and client application. :) When I use the client to connect to the server on the same machine (i.e. the IP is 127.0.0.1) it makes a secure connection. :) When I use the client on my XP machine to connect to the server on my Vista machine then the line:
authStream.EndAuthenticateAsServer(ar);
fails with the exception I pasted into the subject of this post. :( What I want to do is allow any client on any machine over the internet or LAN to connect to my server on port 9000 over an encrypted connection. I would be happy if I could allow the client to specify a username and password - but I don't know how to implement that functionality. details on the exception: $exception
- $exception {"The server has rejected the client credentials."} System.Exception {System.Security.Authentication.InvalidCredentialException}
-
\[System.Security.Authentication.InvalidCredentialException\] {"The server has rejected the client credentials."} System.Security.Authentication.InvalidCredentialException
-
Data {System.Collections.ListDictionaryInternal} System.Collections.IDictionary {System.Collections.ListDictionaryInternal} HelpLink null string
-
InnerException {"The logon attempt failed"} System.Exception {System.ComponentModel.Win32Exception} Message "The server has rejected the client credentials." string Source "System" string StackTrace " at System.Net.Security.NegoState.EndProcessAuthentication(IAsyncResult result)\\r\\n at System.Net.Security.NegotiateStream.EndAuthenticateAsServer(IAsyncResult asyncResult)\\r\\n at RemoteDiagnostics.Server.class\_RDServer.EndAuthenticateCallback(IAsyncResult ar) in C:\\\\Users\\\\Nuclear\\\\Documents\\\\Visual Studio 2008\\\\Projects\\\\RemoteDiagnostics\\\\RemoteDiagnostics\\\\Server\\\\class\_RDServer.cs:line 280" string
-
TargetSite {Void EndProcessAuthentication(System.IAsyncResult)} System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}
authStream
- authStream {System.Net.Security.NegotiateStream} System.Net.Security.NegotiateStream
-
base {System.Net.Security.NegotiateStream} System.
I found an example where the client specifies credentials: http://msdn.microsoft.com/en-us/library/system.net.security.protectionlevel.aspx[^] but I'm not happy that the client needs to know the username and password of the machine that the server is running on. If I have to store username and password for various machines in my exe.config then that seems impractical. I guess I will just go back to using TcpClient.Connect() and encrypting the data myself prior to transmission. :((
-