bschave2
asked on
how do I get logonuser credentials for windows authentication in vb.net?
I am trying to get a user's credentials from windows authentication for vb.net. I have done this in classic asp, but am sure it's more extensive in .NET. Thanks in advance!
You can get the user name with domain from "Context.User.Identity.Nam e"
ASKER
credentials meaning the user's username from the windows authentication window that comes up to log in to any application.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
sort of correct, I had to impersonate the user. Thanks for the help though.
You can get the qualified domain username like:
Dim myUser As String = My.User.Name
If you want to see if the user is authenticated:
If My.User.IsAuthenticated Then...
If you are trying work with another users account, you need to use impersonation: http://weblogs.asp.net/ralfw/archive/2003/11/24/39479.aspx