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. Advertisements

  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. Advertisements

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. Infant Newbie
    Replies:
    2
    Views:
    3,506
    Infant Newbie
    Nov 12, 2003
  2. PHaroZ
    Replies:
    5
    Views:
    97,671
    akash02sap
    Aug 17, 2012
  3. Mike Newton
    Replies:
    0
    Views:
    3,152
    Mike Newton
    Jul 23, 2004
  4. =?Utf-8?B?TWlrZQ==?=

    Mixing Non-ASP.NET & ASP.NET Files in One Domain

    =?Utf-8?B?TWlrZQ==?=, Aug 10, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    425
    Cowboy \(Gregory A. Beamer\)
    Aug 10, 2007
  5. Szabolcs Borsanyi

    Pointer to qualified poitner to qualified object

    Szabolcs Borsanyi, May 30, 2008, in forum: C Programming
    Replies:
    13
    Views:
    843
    Keith Thompson
    Jun 8, 2008
  6. Popezilla
    Replies:
    2
    Views:
    619
    Cowboy \(Gregory A Beamer\)
    Jan 28, 2009
  7. Stefan
    Replies:
    12
    Views:
    531
    Stefan
    Jan 10, 2006
  8. Timo
    Replies:
    0
    Views:
    259
Loading...