Problem to get Windows Logon ID & read file at the same time

Discussion in 'ASP .Net Security' started by genzy, Sep 27, 2006.

  1. genzy

    genzy Guest

    I'm facing the below problem.

    With <deny users="?" />, the Windows Login ID is able to be obtained to
    fill up the Windows IDSID text field automatically, but reading the
    file info is failed.

    Without <deny users="?" />, the Windows Login ID is not able to be
    obtained, but reading the file info is successful.

    Is there any way to make both working at the same time?
    Thanks for advice.

    Windows Logon ID - To get its value
    CODE:
    private string GetLogonUserIdsid()
    {
    string logonUserId = "";
    string logonUser = Request.ServerVariables["LOGON_USER"];

    if (!logonUser.Equals(""))
    {
    // ASCII Table - http://www.lookuptables.com/
    // char '\' = 92
    char[] splitter = {(char) 92};
    string[] strTmp = logonUser.Split(splitter);
    logonUserId = strTmp[1];
    } // End if.

    return logonUserId;
    }

    File Access - To check a file existence
    CODE:
    if (File.Exists(dir+file)) {
    return true;
    }
    else {
    return true;
    }

    web.config
    CODE:
    <authorization>
    <!-- It will deny all unauthenticated or anonymous users. -->
    <deny users="?" />

    <!-- Allow all users -->
    <allow users="*" />

    <!-- Note -->
    <!-- <allow users="[comma separated list of users]"
    roles="[comma separated list of roles]"/>
    <deny users="[comma separated list of users]"
    roles="[comma separated list of roles]"/>
    -->
    </authorization>
    genzy, Sep 27, 2006
    #1
    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. armandotop
    Replies:
    2
    Views:
    384
    Peter Jansson
    Apr 13, 2005
  2. genzy
    Replies:
    0
    Views:
    394
    genzy
    Sep 27, 2006
  3. id10t error
    Replies:
    3
    Views:
    729
    Alexey Smirnov
    Aug 31, 2009
  4. Juri Zenkevitch
    Replies:
    2
    Views:
    185
    Brian C
    Nov 27, 2003
  5. Kjell Kristiansson
    Replies:
    0
    Views:
    286
    Kjell Kristiansson
    Nov 30, 2005
Loading...

Share This Page