Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. (NegotiateStream) The server has rejected the client credentials

(NegotiateStream) The server has rejected the client credentials

Scheduled Pinned Locked Moved C#
csharpsecuritytutorialvisual-studiocom
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    abiemann
    wrote on last edited by
    #1

    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.
      
    A 1 Reply Last reply
    0
    • A abiemann

      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.
        
      A Offline
      A Offline
      abiemann
      wrote on last edited by
      #2

      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. :((

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups