Authenticate users using AD and LDAP

Discussion in 'ASP .Net' started by Sync Walantaji, Nov 15, 2004.

  1. Hi,
    I would like to write a asp.net winform program to authenticate users
    on Active Directory.

    Can I do this with asp.net if the IIS server is not part of the Active
    directory domain?

    Is there a working example link that you can point me to?

    Thanks
    --
    sync
    Sync Walantaji, Nov 15, 2004
    #1
    1. Advertising

  2. Are u interested in forms or in Windows Auth?
    Look at this at:-
    http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q316748
    GDLUCK!


    "Sync Walantaji" wrote:

    > Hi,
    > I would like to write a asp.net winform program to authenticate users
    > on Active Directory.
    >
    > Can I do this with asp.net if the IIS server is not part of the Active
    > directory domain?
    >
    > Is there a working example link that you can point me to?
    >
    > Thanks
    > --
    > sync
    >
    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=, Nov 16, 2004
    #2
    1. Advertising

  3. I'm confused by the IIS setup.
    It says you need to put in a domain account.
    Does this means any domain account that can login to the domain will
    work as an IIS account?

    On Mon, 15 Nov 2004 17:15:02 -0800, "Patrick.O.Ige"
    <> wrote:

    >Are u interested in forms or in Windows Auth?
    >Look at this at:-
    >http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q316748
    >GDLUCK!
    >
    >
    >"Sync Walantaji" wrote:
    >
    >> Hi,
    >> I would like to write a asp.net winform program to authenticate users
    >> on Active Directory.
    >>
    >> Can I do this with asp.net if the IIS server is not part of the Active
    >> directory domain?
    >>
    >> Is there a working example link that you can point me to?
    >>
    >> Thanks
    >> --
    >> sync
    >>
    Sync Walantaji, Nov 16, 2004
    #3
  4. Yep..
    Yes so far u have a domain and the users have accts in the domain it will
    work!
    U just have to pass the LDAP path of ur domain.
    Just make sure that in IIS the virtual directory where ur application
    resides has the
    Anonymous Access clicked or forms Auth won't work.
    [its under the directory Security tab ]
    Enjoy..
    Patrick



    "Sync Walantaji" wrote:

    > I'm confused by the IIS setup.
    > It says you need to put in a domain account.
    > Does this means any domain account that can login to the domain will
    > work as an IIS account?
    >
    > On Mon, 15 Nov 2004 17:15:02 -0800, "Patrick.O.Ige"
    > <> wrote:
    >
    > >Are u interested in forms or in Windows Auth?
    > >Look at this at:-
    > >http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q316748
    > >GDLUCK!
    > >
    > >
    > >"Sync Walantaji" wrote:
    > >
    > >> Hi,
    > >> I would like to write a asp.net winform program to authenticate users
    > >> on Active Directory.
    > >>
    > >> Can I do this with asp.net if the IIS server is not part of the Active
    > >> directory domain?
    > >>
    > >> Is there a working example link that you can point me to?
    > >>
    > >> Thanks
    > >> --
    > >> sync
    > >>

    >
    >
    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=, Nov 16, 2004
    #4
  5. I'm getting the following errors while submitting the form:

    1.Error authenticating. Error authenticating user.
    A referral was returned from the server
    2.Error authenticating. Error obtaining group names. The specified
    domain either does not exist or could not be contacted

    What's the correct syntax to replace this?:
    String adPath = "LDAP://DC=..,DC=..";
    //Path to you LDAP directory server

    I tried
    String adPath =
    "LDAP://domainname.company.com/DC=domainname,DC=company,DC=com";

    String adPath =
    "LDAP://domainname.company.com/ou=active,ou=company.com";

    Basically No clue.
    I can see the program is contacting Domain controller and is using
    kerberros because tcp ports is active....
    I have tried using this code on two different domains. One I created
    myself, one from company central AD. Neither works.
    I can logon to domain shares without any problem, so I know the
    username and password is good on both domain.

    Can someone help to teach me to debug this?




    On Mon, 15 Nov 2004 17:15:02 -0800, "Patrick.O.Ige"
    <> wrote:

    >Are u interested in forms or in Windows Auth?
    >Look at this at:-
    >http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q316748
    >GDLUCK!
    >
    >
    >"Sync Walantaji" wrote:
    >
    >> Hi,
    >> I would like to write a asp.net winform program to authenticate users
    >> on Active Directory.
    >>
    >> Can I do this with asp.net if the IIS server is not part of the Active
    >> directory domain?
    >>
    >> Is there a working example link that you can point me to?
    >>
    >> Thanks
    >> --
    >> sync
    >>
    Sync Walantaji, Nov 16, 2004
    #5
  6. Hi Sync,
    Actually the form Auth on the msdn never worked completely for me
    too!But ur LDAP should be like
    this :-String adPath =LDAP://code.com.au/DC=code,DC=com,DC=au
    'm not quiet sure now bcos i'm out of the office on the road.
    What i noticed in the code is that i could never get group Names.
    So my advice is comment out the function code that is meant to get the
    GROUPS and 'm sure u would authenticate!
    If not mail me to and i'd help u sort that out.
    Enjoy
    Patrick




    "Sync Walantaji" <> wrote in message
    news:...
    > I'm getting the following errors while submitting the form:
    >
    > 1.Error authenticating. Error authenticating user.
    > A referral was returned from the server
    > 2.Error authenticating. Error obtaining group names. The specified
    > domain either does not exist or could not be contacted
    >
    > What's the correct syntax to replace this?:
    > String adPath = "LDAP://DC=..,DC=..";
    > //Path to you LDAP directory server
    >
    > I tried
    > String adPath =
    > "LDAP://domainname.company.com/DC=domainname,DC=company,DC=com";
    >
    > String adPath =
    > "LDAP://domainname.company.com/ou=active,ou=company.com";
    >
    > Basically No clue.
    > I can see the program is contacting Domain controller and is using
    > kerberros because tcp ports is active....
    > I have tried using this code on two different domains. One I created
    > myself, one from company central AD. Neither works.
    > I can logon to domain shares without any problem, so I know the
    > username and password is good on both domain.
    >
    > Can someone help to teach me to debug this?
    >
    >
    >
    >
    > On Mon, 15 Nov 2004 17:15:02 -0800, "Patrick.O.Ige"
    > <> wrote:
    >
    > >Are u interested in forms or in Windows Auth?
    > >Look at this at:-
    > >http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q316748
    > >GDLUCK!
    > >
    > >
    > >"Sync Walantaji" wrote:
    > >
    > >> Hi,
    > >> I would like to write a asp.net winform program to authenticate users
    > >> on Active Directory.
    > >>
    > >> Can I do this with asp.net if the IIS server is not part of the Active
    > >> directory domain?
    > >>
    > >> Is there a working example link that you can point me to?
    > >>
    > >> Thanks
    > >> --
    > >> sync
    > >>

    >
    Patrick.O.Ige, Nov 16, 2004
    #6
  7. Ok, it's working except the group thing...
    Thanks

    On Tue, 16 Nov 2004 22:01:06 +1100, "Patrick.O.Ige"
    <> wrote:

    >Hi Sync,
    > Actually the form Auth on the msdn never worked completely for me
    >too!But ur LDAP should be like
    >this :-String adPath =LDAP://code.com.au/DC=code,DC=com,DC=au
    >'m not quiet sure now bcos i'm out of the office on the road.
    >What i noticed in the code is that i could never get group Names.
    >So my advice is comment out the function code that is meant to get the
    >GROUPS and 'm sure u would authenticate!
    >If not mail me to and i'd help u sort that out.
    >Enjoy
    >Patrick
    >
    >
    >
    >
    >"Sync Walantaji" <> wrote in message
    >news:...
    >> I'm getting the following errors while submitting the form:
    >>
    >> 1.Error authenticating. Error authenticating user.
    >> A referral was returned from the server
    >> 2.Error authenticating. Error obtaining group names. The specified
    >> domain either does not exist or could not be contacted
    >>
    >> What's the correct syntax to replace this?:
    >> String adPath = "LDAP://DC=..,DC=..";
    >> //Path to you LDAP directory server
    >>
    >> I tried
    >> String adPath =
    >> "LDAP://domainname.company.com/DC=domainname,DC=company,DC=com";
    >>
    >> String adPath =
    >> "LDAP://domainname.company.com/ou=active,ou=company.com";
    >>
    >> Basically No clue.
    >> I can see the program is contacting Domain controller and is using
    >> kerberros because tcp ports is active....
    >> I have tried using this code on two different domains. One I created
    >> myself, one from company central AD. Neither works.
    >> I can logon to domain shares without any problem, so I know the
    >> username and password is good on both domain.
    >>
    >> Can someone help to teach me to debug this?
    >>
    >>
    >>
    >>
    >> On Mon, 15 Nov 2004 17:15:02 -0800, "Patrick.O.Ige"
    >> <> wrote:
    >>
    >> >Are u interested in forms or in Windows Auth?
    >> >Look at this at:-
    >> >http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q316748
    >> >GDLUCK!
    >> >
    >> >
    >> >"Sync Walantaji" wrote:
    >> >
    >> >> Hi,
    >> >> I would like to write a asp.net winform program to authenticate users
    >> >> on Active Directory.
    >> >>
    >> >> Can I do this with asp.net if the IIS server is not part of the Active
    >> >> directory domain?
    >> >>
    >> >> Is there a working example link that you can point me to?
    >> >>
    >> >> Thanks
    >> >> --
    >> >> sync
    >> >>

    >>

    >
    Sync Walantaji, Nov 16, 2004
    #7
  8. Good its working...
    If you are interested in getting the groups let me know!
    Enjoy!
    Patrick

    "Sync Walantaji" wrote:

    > Ok, it's working except the group thing...
    > Thanks
    >
    > On Tue, 16 Nov 2004 22:01:06 +1100, "Patrick.O.Ige"
    > <> wrote:
    >
    > >Hi Sync,
    > > Actually the form Auth on the msdn never worked completely for me
    > >too!But ur LDAP should be like
    > >this :-String adPath =LDAP://code.com.au/DC=code,DC=com,DC=au
    > >'m not quiet sure now bcos i'm out of the office on the road.
    > >What i noticed in the code is that i could never get group Names.
    > >So my advice is comment out the function code that is meant to get the
    > >GROUPS and 'm sure u would authenticate!
    > >If not mail me to and i'd help u sort that out.
    > >Enjoy
    > >Patrick
    > >
    > >
    > >
    > >
    > >"Sync Walantaji" <> wrote in message
    > >news:...
    > >> I'm getting the following errors while submitting the form:
    > >>
    > >> 1.Error authenticating. Error authenticating user.
    > >> A referral was returned from the server
    > >> 2.Error authenticating. Error obtaining group names. The specified
    > >> domain either does not exist or could not be contacted
    > >>
    > >> What's the correct syntax to replace this?:
    > >> String adPath = "LDAP://DC=..,DC=..";
    > >> //Path to you LDAP directory server
    > >>
    > >> I tried
    > >> String adPath =
    > >> "LDAP://domainname.company.com/DC=domainname,DC=company,DC=com";
    > >>
    > >> String adPath =
    > >> "LDAP://domainname.company.com/ou=active,ou=company.com";
    > >>
    > >> Basically No clue.
    > >> I can see the program is contacting Domain controller and is using
    > >> kerberros because tcp ports is active....
    > >> I have tried using this code on two different domains. One I created
    > >> myself, one from company central AD. Neither works.
    > >> I can logon to domain shares without any problem, so I know the
    > >> username and password is good on both domain.
    > >>
    > >> Can someone help to teach me to debug this?
    > >>
    > >>
    > >>
    > >>
    > >> On Mon, 15 Nov 2004 17:15:02 -0800, "Patrick.O.Ige"
    > >> <> wrote:
    > >>
    > >> >Are u interested in forms or in Windows Auth?
    > >> >Look at this at:-
    > >> >http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q316748
    > >> >GDLUCK!
    > >> >
    > >> >
    > >> >"Sync Walantaji" wrote:
    > >> >
    > >> >> Hi,
    > >> >> I would like to write a asp.net winform program to authenticate users
    > >> >> on Active Directory.
    > >> >>
    > >> >> Can I do this with asp.net if the IIS server is not part of the Active
    > >> >> directory domain?
    > >> >>
    > >> >> Is there a working example link that you can point me to?
    > >> >>
    > >> >> Thanks
    > >> >> --
    > >> >> sync
    > >> >>
    > >>

    > >

    >
    >
    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=, Nov 17, 2004
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Edwin Knoppert
    Replies:
    1
    Views:
    400
    Edwin Knoppert
    Sep 8, 2006
  2. Replies:
    1
    Views:
    446
    Manuel Ricca
    Dec 13, 2007
  3. Hutty

    Authenticate User with LDAP

    Hutty, Aug 12, 2008, in forum: ASP .Net Security
    Replies:
    0
    Views:
    712
    Hutty
    Aug 12, 2008
  4. Brad Leach

    Using a Web Service to Authenticate Users

    Brad Leach, Sep 22, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    130
    Brad Leach
    Sep 22, 2003
  5. sean nakasone

    authenticate users using windows authentication

    sean nakasone, Apr 24, 2007, in forum: Javascript
    Replies:
    0
    Views:
    107
    sean nakasone
    Apr 24, 2007
Loading...

Share This Page