.NET Windows Service: Credentials

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sakalicek
    New Member
    • Mar 2007
    • 51

    .NET Windows Service: Credentials

    Hello.

    I have problem with network credentials on my Windows service.

    I have 2 PCs.
    On the first PC I create controller which calls windows service on the other PC.
    Always I got InvalidCredenti alException when I try to call service.

    Coud you please help me to fix it?
    I have read something about it and also tried something, but it doesnt help much.

    One solution of this problem coud be to set the windows service on the second PC to run under some speficied acccount instead of local account.

    But I d not like to make it this way.

    Thx for eny hep.

    Zdenek.
  • radcaesar
    Recognized Expert Contributor
    • Sep 2006
    • 759

    #2
    You should have the exact same account setup on both machines.

    Comment

    • Sakalicek
      New Member
      • Mar 2007
      • 51

      #3
      Yes, that I thought, but isnt there some way how to solve it more "like programmer"?

      I thought something about channels or something like that.

      Originally posted by radcaesar
      You should have the exact same account setup on both machines.

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        Originally posted by Sakalicek
        Yes, that I thought, but isnt there some way how to solve it more "like programmer"?

        I thought something about channels or something like that.
        Could you please provide us with a bit more information about the application you are developing.

        Is it a Web Application, a Web Service, or other?

        Thanks

        -Frinny

        Comment

        • Sakalicek
          New Member
          • Mar 2007
          • 51

          #5
          On the first PC there is installed Windows Service.
          This one calls other Windows Service on the other PC.
          Both PCs are Virtual Machines on Virtual Machine Server.
          So both PCs run under the VMuser account.
          So I think that there cant be any problem with credentials, but there is.

          If I try to call the Windows Service on the second PC from my computer (connected), I get an error with network credentials.

          Originally posted by Frinavale
          Could you please provide us with a bit more information about the application you are developing.

          Is it a Web Application, a Web Service, or other?

          Thanks

          -Frinny

          Comment

          • Frinavale
            Recognized Expert Expert
            • Oct 2006
            • 9749

            #6
            Originally posted by Sakalicek
            On the first PC there is installed Windows Service.
            This one calls other Windows Service on the other PC.
            Both PCs are Virtual Machines on Virtual Machine Server.
            So both PCs run under the VMuser account.
            So I think that there cant be any problem with credentials, but there is.

            If I try to call the Windows Service on the second PC from my computer (connected), I get an error with network credentials.
            Sorry I had miss read the question earlier....you had already stated that it was a Windows Service.
            >>blushes<<

            I'm not sure I can help with this problem but here's what MSDN has to say on the exception you're facing:

            "The NegotiateStream and SslStream classes throw this exception when authentication fails. This exception indicates that the underlying stream is not in a valid state and you cannot retry the authentication using the NegotiateStream or SslStream instance."

            Could it be that your Virtual Machine Server is some how unable to get this stream that is talked about here?

            This is probably something that's not configured properly.

            Comment

            • Sakalicek
              New Member
              • Mar 2007
              • 51

              #7
              Hi, I already solved it.
              So I created another Remote provider with channels and network credentials.
              It s now working.

              Comment

              Working...