Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Login

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
0
0
US
I was wondering if someone can point me in the right direction. I'm creating a simple asp.net app and wanted to avoid the domain users logging into the app. I would like to use their domain credentials from their workstation login. Not sure how to do this.

Any help would be appreciated.

Thanks

 
I don't know if this issue is resolved but you can add the following to your web.config file:
Code:
<authentication mode="Windows"/> 
<authorization>
   <allow roles="DomainName\Administrators"/> 
</authorization>

<identity impersonate="true"/>

Note: Replace DomainName with your actual domain name.

Also, even though identity impersonation is activated, it is not mandatory. It just provides extra layer of security.

Note also, that even administrators are also allowed access.
 
Thanks. so how do you capture the users name that's logged into the domain/application ?

 


In VB:
Code:
Dim EmployeeLogin As String = Request.ServerVariables("LOGON_USER")
In C#
Code:
string EmployeeLogin = System.Security.Principal.WindowsIdentity.GetCurrent().Name;


Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
Not sure why you broke those lines of code out based on language. You can do both of those lines of code in each language.
Each line will return different values
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top