Home/ASP.NET Forums/Advanced ASP.NET/Active Directory and LDAP/Active Directory And Directory Information

Active Directory And Directory Information RSS

4 replies

Last post Jun 16, 2008 09:32 PM by johram

Cheers,
Robin Kedia
www.robinkedia.com
  • worldclasscoders

    worldclassco...

    Participant

    1730 Points

    342 Posts

    Re: Active Directory And Directory Information

    Jun 13, 2008 05:20 AM|LINK

    You can use the following to determine what user the thread is executing with and without impersonate

    System.Security.Principal.WindowsIdentity.GetCurrent().Name

    Cheers,
    Robin Kedia
    www.robinkedia.com
  • on3

    on3

    0 Points

    2 Posts

    Re: Active Directory And Directory Information

    Jun 13, 2008 05:27 AM|LINK

    Hi there,

    Thanks for replying back.
    During my webpart development, i found i need to impersonate the logged in user with another username in order to read "folder owner" in my file server. Quite contradicting, but anyway, the webpart itself will be used in a SharePoint environment. As far as i understand, SharePoint is also based on ASP.NET, thus putting the <identity impersonate =true userName="user" password="secret" /> will cause sharepoint to use the "user" identity instead of the logged in user. and this scenario is not what i expected.

    is there any way to "change" the web.config setting programmatically in asp.net?
    or other way which can help?

     Thanks in advance :)

     

     

  • johram

    johram

    All-Star

    28531 Points

    3567 Posts

    Re: Active Directory And Directory Information

    Jun 16, 2008 09:32 PM|LINK

    See Ryan Dunn's post which will explain the basic security problems that you are likely to run into and how to solve them: http://forums.asp.net/t/897609.aspx

    If this post was useful to you, please mark it as answer. Thank you!

  • ‹ Previous Thread|Next Thread ›