Accessing ActiveDirectory through LDAP with .NET

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Accessing ActiveDirectory through LDAP with .NET

    I am trying to determine the best way I can authenticate against an
    ActiveDirectory using LDAP with .NET. I need to use LDAP because I need to
    authenticate across the Internet.

    Right now I have code that authenticates (e.g. I pass username/password to
    it) via NTLM but the problem is I am accessing this via a domain user
    account that has access to the domain controller (e.g. it's the account that
    IIS is running under).

    Obviously this doesn't work over the Internet and the only temporary
    solution is for my client to set up a VPN and have a trust relationship,
    which is really not something they want to do.

    I read somewhere (brief blurb) that I could access this information via
    LDAP.

    Essentially I am building sort of a single-sign on application where the
    user enters their name/password in my app and it is authenticated against an
    ActiveDirectory instance.

    Any ideas on how I can do this in a secure manner over the Internet without
    the need for a VPN?

    Thanks,


    Tim Mavers Guest

  2. Similar Questions and Discussions

    1. How to pass Windows login credentials to ActiveDirectory
      Hi, I am using windows integrated authentication for my asp.net intranet application. basically, I have to pass the windows username & password to...
    2. ActiveDirectory Controller & WIN32:Netadmin: GetServers question
      Hi everybody, I have simple (I suppose : ) ) to ask question but not sure if also simple to answer: a piece of perl script: use...
    3. Net::LDAP Vs AD
      Hello, I would like to write modifs to the bugzilla code in order that it can perform integrated security lookups against my active directory...
    4. Accessing LDAP server with ASP
      Hi I am trying to access a LDAP server with ASP with no sucess. I can do it with ColdFusion but not ASP. All the examples I have seen so far do not...
    5. LDAP for AIX 5.1
      Does anyone know the simplest way to configure LDAP on an AIX 5.1 box? Do I have to disable NIS services before? I appricate your help. Right
  3. #2

    Default Re: Accessing ActiveDirectory through LDAP with .NET

    On Tue, 21 Dec 2004 17:16:52 -0600, "Tim Mavers" <webview@hotmail.com> wrote:

    ¤ I am trying to determine the best way I can authenticate against an
    ¤ ActiveDirectory using LDAP with .NET. I need to use LDAP because I need to
    ¤ authenticate across the Internet.
    ¤
    ¤ Right now I have code that authenticates (e.g. I pass username/password to
    ¤ it) via NTLM but the problem is I am accessing this via a domain user
    ¤ account that has access to the domain controller (e.g. it's the account that
    ¤ IIS is running under).
    ¤
    ¤ Obviously this doesn't work over the Internet and the only temporary
    ¤ solution is for my client to set up a VPN and have a trust relationship,
    ¤ which is really not something they want to do.
    ¤
    ¤ I read somewhere (brief blurb) that I could access this information via
    ¤ LDAP.
    ¤
    ¤ Essentially I am building sort of a single-sign on application where the
    ¤ user enters their name/password in my app and it is authenticated against an
    ¤ ActiveDirectory instance.
    ¤
    ¤ Any ideas on how I can do this in a secure manner over the Internet without
    ¤ the need for a VPN?

    It isn't clear to me what type of application this is but you may want to take a look at the
    following:

    HOW TO: Authenticate against the Active Directory by Using Forms Authentication and Visual Basic
    ..NET
    [url]http://support.microsoft.com/default.aspx?scid=kb;en-us;326340[/url]


    Paul ~~~ [email]pclement@ameritech.net[/email]
    Microsoft MVP (Visual Basic)
    Paul Clement Guest

  4. #3

    Default Re: Accessing ActiveDirectory through LDAP with .NET

    Thanks for the link. My application is an ASP.NET app (C#). Will this work
    across the Internet (I didn't seen any mention of security/firewall
    configurations, etc.). In other words, my app is runing at a data-center
    and the AD is at some other company. What would need to happen to access
    the AD (via LDAP) from my app at the datacenter? Our current approach (not
    using LDAP) is to access it through the AD API which needs domain access
    (something the company will not allow across the Internet--for obvious
    reasons). Here's a quick example to help illustrate my problem:

    1. User browses to my login page runing at the datacenter
    2. User enters name and password in my app.
    3. My app then has to (somehow) authenticate the name/pw with the company's
    AD server running at some other datacenter on some part of the planet).

    Thanks,

    Tim
    "Paul Clement" <UseAdddressAtEndofMessage@swspectrum.com> wrote in message
    news:abvis0t9i6ote1nt5g0ak2rdngkil06dn5@4ax.com...
    > On Tue, 21 Dec 2004 17:16:52 -0600, "Tim Mavers" <webview@hotmail.com>
    > wrote:
    >
    > ¤ I am trying to determine the best way I can authenticate against an
    > ¤ ActiveDirectory using LDAP with .NET. I need to use LDAP because I
    > need to
    > ¤ authenticate across the Internet.
    > ¤
    > ¤ Right now I have code that authenticates (e.g. I pass username/password
    > to
    > ¤ it) via NTLM but the problem is I am accessing this via a domain user
    > ¤ account that has access to the domain controller (e.g. it's the account
    > that
    > ¤ IIS is running under).
    > ¤
    > ¤ Obviously this doesn't work over the Internet and the only temporary
    > ¤ solution is for my client to set up a VPN and have a trust relationship,
    > ¤ which is really not something they want to do.
    > ¤
    > ¤ I read somewhere (brief blurb) that I could access this information via
    > ¤ LDAP.
    > ¤
    > ¤ Essentially I am building sort of a single-sign on application where the
    > ¤ user enters their name/password in my app and it is authenticated
    > against an
    > ¤ ActiveDirectory instance.
    > ¤
    > ¤ Any ideas on how I can do this in a secure manner over the Internet
    > without
    > ¤ the need for a VPN?
    >
    > It isn't clear to me what type of application this is but you may want to
    > take a look at the
    > following:
    >
    > HOW TO: Authenticate against the Active Directory by Using Forms
    > Authentication and Visual Basic
    > .NET
    > [url]http://support.microsoft.com/default.aspx?scid=kb;en-us;326340[/url]
    >
    >
    > Paul ~~~ [email]pclement@ameritech.net[/email]
    > Microsoft MVP (Visual Basic)

    Tim Mavers Guest

  5. #4

    Default Re: Accessing ActiveDirectory through LDAP with .NET

    On Mon, 27 Dec 2004 12:36:30 -0600, "Tim Mavers" <webview@hotmail.com> wrote:

    ¤ Thanks for the link. My application is an ASP.NET app (C#). Will this work
    ¤ across the Internet (I didn't seen any mention of security/firewall
    ¤ configurations, etc.). In other words, my app is runing at a data-center
    ¤ and the AD is at some other company. What would need to happen to access
    ¤ the AD (via LDAP) from my app at the datacenter? Our current approach (not
    ¤ using LDAP) is to access it through the AD API which needs domain access
    ¤ (something the company will not allow across the Internet--for obvious
    ¤ reasons). Here's a quick example to help illustrate my problem:
    ¤
    ¤ 1. User browses to my login page runing at the datacenter
    ¤ 2. User enters name and password in my app.
    ¤ 3. My app then has to (somehow) authenticate the name/pw with the company's
    ¤ AD server running at some other datacenter on some part of the planet).

    Is your web server (that is hosting your application) a member of the domain that you need to
    authenticate against?


    Paul ~~~ [email]pclement@ameritech.net[/email]
    Microsoft MVP (Visual Basic)
    Paul Clement Guest

  6. #5

    Default Re: Accessing ActiveDirectory through LDAP with .NET

    "Paul Clement" <UseAdddressAtEndofMessage@swspectrum.com> wrote in message
    news:r4r0t09m3obnfsr6l3mh4psd4q82lspj0j@4ax.com...
    > Is your web server (that is hosting your application) a member of the
    > domain that you need to
    > authenticate against?
    No, that is the problem. The application runs at a separate site but the
    client wants their users to be able to log in with their local (domain)
    name/password (i.e. not a separately managed name/password for my app). I
    am trying to figure out a secure way of authenticating against the domain
    across the Internet.

    In regards to LDAP, how does it address these types of issues? How would
    someone be able to authenticate against an LDAP server?

    Is this even possible?

    There are solutions where you set up a VPN and then have the company domain
    trust the domain the site runs under but that is pretty much out of the
    question as my client is not going to trust a foreign domain (from the
    datacenter) where IIS is running under.

    Thanks,

    Tom


    Tim Mavers Guest

  7. #6

    Default Re: Accessing ActiveDirectory through LDAP with .NET

    On Mon, 27 Dec 2004 15:42:29 -0600, "Tim Mavers" <webview@hotmail.com> wrote:

    ¤ "Paul Clement" <UseAdddressAtEndofMessage@swspectrum.com> wrote in message
    ¤ news:r4r0t09m3obnfsr6l3mh4psd4q82lspj0j@4ax.com...
    ¤ > Is your web server (that is hosting your application) a member of the
    ¤ > domain that you need to
    ¤ > authenticate against?
    ¤
    ¤ No, that is the problem. The application runs at a separate site but the
    ¤ client wants their users to be able to log in with their local (domain)
    ¤ name/password (i.e. not a separately managed name/password for my app). I
    ¤ am trying to figure out a secure way of authenticating against the domain
    ¤ across the Internet.
    ¤
    ¤ In regards to LDAP, how does it address these types of issues? How would
    ¤ someone be able to authenticate against an LDAP server?
    ¤
    ¤ Is this even possible?
    ¤
    ¤ There are solutions where you set up a VPN and then have the company domain
    ¤ trust the domain the site runs under but that is pretty much out of the
    ¤ question as my client is not going to trust a foreign domain (from the
    ¤ datacenter) where IIS is running under.
    ¤

    Well I have to scratch my head a bit about this scenario. It's rather difficult
    to authenticate against a domain that you don't have access to. ;-)

    I wish I had a better answer for you but the bottom line is that you don't have
    direct access to an authentication mechanism for the client site. If all that
    you need to do is validate credentials via LDAP you could use a Web Service, but
    it would need to be running on the client site.


    Paul ~~~ [email]pclement@ameritech.net[/email]
    Microsoft MVP (Visual Basic)
    Paul Clement Guest

  8. #7

    Default Re: Accessing ActiveDirectory through LDAP with .NET

    Tim ..ur scenario is quite difficult as Paul adviced..
    if IIS is not a member of the Domain u want to validate against .u can't
    use Active Directory then..(only if they agree to use a trust
    relationship)
    Is it possible for you to validate against Database.?.
    that could solve your problem then..
    Patrick



    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Patrick Olurotimi Ige Guest

  9. #8

    Default Re: Accessing ActiveDirectory through LDAP with .NET

    "Paul Clement" <UseAdddressAtEndofMessage@swspectrum.com> wrote in message
    news:ruv2t0hjl5rjqf3kfsorr1mtie7dhg285a@4ax.com...
    > Well I have to scratch my head a bit about this scenario. It's rather
    > difficult
    > to authenticate against a domain that you don't have access to. ;-)
    I guess a better to put it this is there a way I can authenticate against an
    ActiveDirectory using LDAP via LDAP's credentials vs using Microsoft's
    credentials.

    For example, if I am running some LDAP server under Linux and I want to
    authenticate against it, I would need to include some sort of credentials
    (ones that have nothing to do with ActiveDirectory).

    Since ActiveDirectory supports LDAP, can this be done under a Windows
    environment? Since in other words, what would have to happen to allow me to
    authenticate against ACtiveDirectory? I would have to open up all these
    ports and then expose my domain publicly to the Internet (vs. just having an
    LDAP interface exposed)?

    Thanks,


    Tim Mavers Guest

  10. #9

    Default Re: Accessing ActiveDirectory through LDAP with .NET

    Tim..
    Try looking at this article:-

    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetse[/url]
    c/html/SecNetHT02.asp

    U can authenticate against A Directory.
    Hope it helps
    Patrick


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Patrick Olurotimi Ige Guest

  11. #10

    Default Re: Accessing ActiveDirectory through LDAP with .NET

    On Wed, 29 Dec 2004 12:33:10 -0600, "Tim Mavers" <webview@hotmail.com> wrote:

    ¤ "Paul Clement" <UseAdddressAtEndofMessage@swspectrum.com> wrote in message
    ¤ news:ruv2t0hjl5rjqf3kfsorr1mtie7dhg285a@4ax.com...
    ¤ > Well I have to scratch my head a bit about this scenario. It's rather
    ¤ > difficult
    ¤ > to authenticate against a domain that you don't have access to. ;-)
    ¤
    ¤ I guess a better to put it this is there a way I can authenticate against an
    ¤ ActiveDirectory using LDAP via LDAP's credentials vs using Microsoft's
    ¤ credentials.
    ¤
    ¤ For example, if I am running some LDAP server under Linux and I want to
    ¤ authenticate against it, I would need to include some sort of credentials
    ¤ (ones that have nothing to do with ActiveDirectory).
    ¤
    ¤ Since ActiveDirectory supports LDAP, can this be done under a Windows
    ¤ environment? Since in other words, what would have to happen to allow me to
    ¤ authenticate against ACtiveDirectory? I would have to open up all these
    ¤ ports and then expose my domain publicly to the Internet (vs. just having an
    ¤ LDAP interface exposed)?

    You can authenticate with the Windows domain but I don't know how you would automatically
    authenticate with the Linux server unless you have some kind of integrated authentication or trust
    between the domains.


    Paul ~~~ [email]pclement@ameritech.net[/email]
    Microsoft MVP (Visual Basic)
    Paul Clement Guest

  12. #11

    Default Re: Accessing ActiveDirectory through LDAP with .NET

    "Paul Clement" <UseAdddressAtEndofMessage@swspectrum.com> wrote in message
    news:154jt0hcrpu69ka96cjnrhkgs5lutgqrf9@4ax.com...
    > You can authenticate with the Windows domain but I don't know how you
    > would automatically
    > authenticate with the Linux server unless you have some kind of integrated
    > authentication or trust
    > between the domains.
    Could I do this:

    Make a .NET call (of some sort) across the Internet using an LDAP name and
    password (for an account that is valid on the NT domain)?

    Basically all I want to do is pass a username and password through LDAP and
    have an ActiveDirectory validate it.

    Another angle... Let's say I have some LDAP server that has a bunch of
    usernames and passwords. I should be able to enter a username/password and
    have the ldap server authenticate it correct? If this server happens to be
    an ActiveDirectory server, wouldn't the list of users it uses to look up (to
    authenticate) be the same as the ones in the AD?

    I simply am trying to pass credentials across the Internet to be
    authenticated.

    Thanks,


    Tim Mavers Guest

  13. #12

    Default Re: Accessing ActiveDirectory through LDAP with .NET

    On Wed, 5 Jan 2005 16:39:05 -0600, "Tim Mavers" <webview@hotmail.com> wrote:

    ¤ "Paul Clement" <UseAdddressAtEndofMessage@swspectrum.com> wrote in message
    ¤ news:154jt0hcrpu69ka96cjnrhkgs5lutgqrf9@4ax.com...
    ¤ > You can authenticate with the Windows domain but I don't know how you
    ¤ > would automatically
    ¤ > authenticate with the Linux server unless you have some kind of integrated
    ¤ > authentication or trust
    ¤ > between the domains.
    ¤
    ¤ Could I do this:
    ¤
    ¤ Make a .NET call (of some sort) across the Internet using an LDAP name and
    ¤ password (for an account that is valid on the NT domain)?
    ¤
    ¤ Basically all I want to do is pass a username and password through LDAP and
    ¤ have an ActiveDirectory validate it.
    ¤
    ¤ Another angle... Let's say I have some LDAP server that has a bunch of
    ¤ usernames and passwords. I should be able to enter a username/password and
    ¤ have the ldap server authenticate it correct? If this server happens to be
    ¤ an ActiveDirectory server, wouldn't the list of users it uses to look up (to
    ¤ authenticate) be the same as the ones in the AD?
    ¤
    ¤ I simply am trying to pass credentials across the Internet to be
    ¤ authenticated.

    OK, eliminating any other potential issues or system configurations from the equation you may want
    to see if the System.Net.WebRequest class will work for you. You should be able to use this class to
    pass your credentials:

    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemNetWebRequestClassTopic.asp[/url]


    Paul ~~~ [email]pclement@ameritech.net[/email]
    Microsoft MVP (Visual Basic)
    Paul Clement Guest

  14. #13

    Default RE: Accessing ActiveDirectory through LDAP with .NET

    Tim,

    How about this scenario:

    1. At the client's network, add a web server (running IIS) and add the
    appropriate dns entries to expose [[url]http://example.timsclient.corp][/url]. I'll
    assume you know the rest of adding another IP to the box and creating a new
    web site, assigning the IP to that site......

    2. Create a web service that takes the user credentials as params and
    authenticates against the AD.

    3. Consume this web service in your app at the datacenter.

    This should also allow future apps written in whatever to access the
    centralized authentication web service.

    In my last job, my employer dictated that we would use PKI...we used a
    similar design to incorporate authentication in multiple apps written in Java
    and ASP.Net....

    Ryan

    "Tim Mavers" wrote:
    > I am trying to determine the best way I can authenticate against an
    > ActiveDirectory using LDAP with .NET. I need to use LDAP because I need to
    > authenticate across the Internet.
    >
    > Right now I have code that authenticates (e.g. I pass username/password to
    > it) via NTLM but the problem is I am accessing this via a domain user
    > account that has access to the domain controller (e.g. it's the account that
    > IIS is running under).
    >
    > Obviously this doesn't work over the Internet and the only temporary
    > solution is for my client to set up a VPN and have a trust relationship,
    > which is really not something they want to do.
    >
    > I read somewhere (brief blurb) that I could access this information via
    > LDAP.
    >
    > Essentially I am building sort of a single-sign on application where the
    > user enters their name/password in my app and it is authenticated against an
    > ActiveDirectory instance.
    >
    > Any ideas on how I can do this in a secure manner over the Internet without
    > the need for a VPN?
    >
    > Thanks,
    >
    >
    >
    RBrady Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139