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. Validate User Against Active Directory

Validate User Against Active Directory

Scheduled Pinned Locked Moved C#
tutorialwindows-adminhardwarehelpquestion
4 Posts 2 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.
  • K Offline
    K Offline
    Kevin Marois
    wrote on last edited by
    #1

    We have a medical device that is connected to the LAN but is not on Active Directory. The instrument is running Windows Embedded as a service. When a user logs into the device we want to validate them against AD. I've found plenty of example of validating users, but they all seem to assume that the code is being run under an account of an AD user. How to I validate a user against AD when the instrument isn't on AD?

    If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

    K 1 Reply Last reply
    0
    • K Kevin Marois

      We have a medical device that is connected to the LAN but is not on Active Directory. The instrument is running Windows Embedded as a service. When a user logs into the device we want to validate them against AD. I've found plenty of example of validating users, but they all seem to assume that the code is being run under an account of an AD user. How to I validate a user against AD when the instrument isn't on AD?

      If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

      K Offline
      K Offline
      Keviniano Gayo
      wrote on last edited by
      #2

      The device should able to connect AD to validate the user. Or you could create a web service that can connect to AD and let the medical device call that web service to verify the user.

      K 1 Reply Last reply
      0
      • K Keviniano Gayo

        The device should able to connect AD to validate the user. Or you could create a web service that can connect to AD and let the medical device call that web service to verify the user.

        K Offline
        K Offline
        Kevin Marois
        wrote on last edited by
        #3

        Keviniano Gayo wrote:

        The device should able to connect AD to validate the user.

        Unless someone logs into Windows on the device, it won't connect. Here's how I'm trying

        using (var context = new PrincipalContext(ContextType.Domain, credentials.ServerName, credentials.UserName, credentials.Password))
        {
        validated = context.ValidateCredentials(userName, password);
        }

        Again, this works if someone is logged into Windows. if not, it doesn't

        If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

        K 1 Reply Last reply
        0
        • K Kevin Marois

          Keviniano Gayo wrote:

          The device should able to connect AD to validate the user.

          Unless someone logs into Windows on the device, it won't connect. Here's how I'm trying

          using (var context = new PrincipalContext(ContextType.Domain, credentials.ServerName, credentials.UserName, credentials.Password))
          {
          validated = context.ValidateCredentials(userName, password);
          }

          Again, this works if someone is logged into Windows. if not, it doesn't

          If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

          K Offline
          K Offline
          Keviniano Gayo
          wrote on last edited by
          #4

          I see.. i haven't tried connecting to AD without logging into windows. I used the same code as above to verify the user in AD. Perhaps calling a custom web service to verify a user in AD would be the best route.

          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