Hi all,
Bernado:
I have a question about your manual impersonation method. One of the parametersis the password. Did you get that from the user input when they typed it into the login form? Or do you have someway to work it out??
Sorry, I completely looked over that question. I store the password in a Session Variable, I'm not so sure this is a safe way to go .... maybe I should encrypt it before storing it.
Oh, and I do get it from the login-control (this is on my login page) (code behind):
Protected Sub LoginControl_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles LoginControl.Authenticate
If ValidateUser(Me.LoginControl.UserName, Me.LoginControl.Password) Then
e.Authenticated = True
Session("PassNT") = Me.LoginControl.Password
Else
e.Authenticated = False
Me.LoginControl.FailureText = "You are not an Authenticated User. Please contact the Administrator."
End If
End Sub
asp_guy:
, too, don't understand why seeing "impersonation=true" in web.config does not work. However, as Bernado pointed out, perhaps it's because the authentication info is not delegated to remote machines? (By the way, I tried the suggestion of accessing my script from the local machine, and it still fails)
Hi asp_guy, well, the perhaps can be commented out here, I'm quite sure he was right. After he said that, I did some more researching and came to this site: http://www.microsoft.com/technet/community/columns/insider/iisi0803.mspx . Here they say the following (well, it was a question about basic auth. versus windows auth. but the answer confirms Bernado's ...euhm sayings :) ):
"... However, when you authenticate to an IIS server using Integrated Windows, the result is type of logon called a “Network” logon. This kind of logon is far more secure than Basic, but the credentials cannot be forwarded to another server, unless Kerberos is used in the intranet. In the event that Kerberos is used (when properly configured), the user’s credentials can be delegated throughout the forest ..."
About your code not working when trying it locally: Euhm, can you browse to the UNC- path through your Windows-Explorer? What is the error you are getting?
(Btw, you can hy-jack my threads any time as long as you do it in a nice and friendly way
)
Bernado:
Bernado, thanks man!, I'll give that link a look, but I'm gonna do it next week because I'm tired and still must do some other tasks.
naturehermit:
Why not try multi-authentication, i.e. authentication for network share differently then the actual intranet. Just suggesting this as other way. Even windows does that for your network share, despite you having permission on that resource from your credentials on Active Directory. That keeps the two as seperate entties.
Hi naturehermit,
Do I understand you well? So, let's say, the user log's in, and then I can perform an extra authentication on the network share (example: \\myFileServer1\UseFullDocuments) at the start of the application. That would be sweet! If that was possible, maybe the programmatical impersonation wouldn't be necessary anymore. But, this is something new to me, I'm gonna check it out next week because I'm tired ;)
Thanks all for sharing in this thread,
I am once again a bit wiser :p
Wim
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.