Hello,
I have an intranet site currently running DNN 4.9.4, working well with AD authentication provider. forms authentication is specified in web.config, since we need to allow both domain users and DNN users (for example at host level), and impersonation is enabled:
<forms name=".DOTNETNUKE" protection="All" timeout="525600" cookieless="UseCookies" slidingExpiration="true" />
</authentication>
<identity impersonate="true" userName="domain\intranetuser" password="pwdpwd" />
Question is: shouldn't users inherit this profile when accessing the file system?
Problem: in a custom module I need to access some files on a remote server; I have a line of code that gets a list of files via SMB, and then displays them:
Dim filesList() As String = IO.Directory.GetFiles("\\server\path\userfolder")
This is working perfectly when current user is an administrator, but I get access denied errors for normal domain users. However, SMB path points to folders for which permissions are given for each user: if I open the same path in Windows Explorer I can see the files. So why is this failing from code?
I verified that both HttpContext.Current.User.Identity.Name and System.Threading.Thread.CurrentPrincipal.Identity.Name show the currently logged-on user (DOMAIN\Username - with impersonation enabled I'd say I should see the user I put in web.config here, but this is not -), which should be ok since permissions are given for that user. But I get access denied.
Can anybody tell where's my error?
Thank you,
al.