Solved

How to use Windows domain login to authenticate ASP.net website?

Posted on 2013-11-05
9
349 Views
Last Modified: 2013-11-11
I want to use my company's windows domain to authenticate my ASP.net website and capture the Username/userID and verify the credentials from the tables I created.
How do I do this?
0
Comment
Question by:Raj_donet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
9 Comments
 
LVL 23

Expert Comment

by:Jens Fiederer
ID: 39624199
You can use an authentication mode of Windows.  See

http://msdn.microsoft.com/en-us/library/aa291347(v=vs.71).aspx
0
 
LVL 23

Expert Comment

by:Jens Fiederer
ID: 39624212
You can then use
HttpContext.Current.User.Identity.Name
to find the user name of whoever is logged in.   Note this works for INTRANET web sites...for web sites facing the world you are better off with Forms authentication  (or one of the open source identity providers)
0
 

Author Comment

by:Raj_donet
ID: 39627257
When I use  <authentication mode="Windows"> in web.config, nothing is happening. Can you explain in detail. I am new to this.
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

Author Comment

by:Raj_donet
ID: 39627259
I tried using Basic authentication and it works fine, but it throws popup login when page loads, is there a way we can use the same functionality integrating in Login page?
0
 
LVL 23

Expert Comment

by:Jens Fiederer
ID: 39627923
If you use Windows authentication mode, nothing SHOULD happen.   You are already logged into Windows, so there is no need for an authentication page....the user name should just magically be in HttpContext.Current.User.Identity.Name.

What kind of environment do you have?  Are you working at a company where you are part of a domain?

Or do you just have your own desktop?
0
 
LVL 23

Expert Comment

by:Jens Fiederer
ID: 39630287
(sorry, forgot you already mentioned you were in your company domain...but details could still be useful)
0
 
LVL 23

Expert Comment

by:Jens Fiederer
ID: 39630396
(note that you also need to disable anonymous auth, or it won't bother going through windows auth)
0
 
LVL 23

Accepted Solution

by:
Jens Fiederer earned 500 total points
ID: 39630401
0
 

Author Closing Comment

by:Raj_donet
ID: 39639415
Thanks
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how the fundamental information of how to create a table.

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question