Get full-qualified user-domain in asp.net

Discussion in 'ASP .Net Security' started by Markus Strobl, Jun 2, 2008.

  1. Hi!

    I'm currently developing an ASP.NET application which uses Windows
    Integrated Security to display different data depending on the Windows User
    how requests the page.

    So far so good but i also need to get the full qualified name of the user
    domain visiting the page to make my app work properly.

    I'm currently reading the logged on user by a call to
    Request.ServerVariables["LOGON_USER"] but this call will only give me the
    short domain name (i.e. i get "myDomain\Markus" but i need
    "myDomain.rbgooe.at\Markus").

    Is there any way to do it using ASP.NET technology? Or will i have to use
    ActiveDirectory-Queries to resolve the domain name?

    Thanks a lot for any advice!

    Greetings

    Markus
     
    Markus Strobl, Jun 2, 2008
    #1
    1. Advertising

  2. ok i was able to solve the problem on my own using .net active directory
    support :

    the following call gave me just what i needed:
    System.DirectoryServices.ActiveDirectory.Domain domain =
    System.DirectoryServices.ActiveDirectory.Domain.GetCurrentDomain();

    Description from MSDN: "... Gets the Domain object for the current user
    credentials in effect for the security context under which the application
    is running...."

    Greetings

    Markus





    "Markus Strobl" <> schrieb im
    Newsbeitrag news:%23d8%235$...
    > Hi!
    >
    > I'm currently developing an ASP.NET application which uses Windows
    > Integrated Security to display different data depending on the Windows
    > User how requests the page.
    >
    > So far so good but i also need to get the full qualified name of the user
    > domain visiting the page to make my app work properly.
    >
    > I'm currently reading the logged on user by a call to
    > Request.ServerVariables["LOGON_USER"] but this call will only give me the
    > short domain name (i.e. i get "myDomain\Markus" but i need
    > "myDomain.rbgooe.at\Markus").
    >
    > Is there any way to do it using ASP.NET technology? Or will i have to use
    > ActiveDirectory-Queries to resolve the domain name?
    >
    > Thanks a lot for any advice!
    >
    > Greetings
    >
    > Markus
    >
    >
     
    Markus Strobl, Jun 2, 2008
    #2
    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. Frank Drebin

    Re: fully qualified domain name

    Frank Drebin, Aug 26, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    617
    Frank Drebin
    Aug 26, 2003
  2. Mike Newton
    Replies:
    0
    Views:
    2,964
    Mike Newton
    Jul 23, 2004
  3. Steve C. Orr [MVP, MCSD]
    Replies:
    0
    Views:
    1,676
    Steve C. Orr [MVP, MCSD]
    Jul 23, 2004
  4. Szabolcs Borsanyi

    Pointer to qualified poitner to qualified object

    Szabolcs Borsanyi, May 30, 2008, in forum: C Programming
    Replies:
    13
    Views:
    589
    Keith Thompson
    Jun 8, 2008
  5. Steven Simpson
    Replies:
    0
    Views:
    753
    Steven Simpson
    Feb 6, 2012
Loading...

Share This Page