Solved

Is there a way to skip log on using code for an asp.net application?

Posted on 2014-12-29
8
320 Views
Last Modified: 2014-12-31
Hi, I'm using vs2012, c# and asp.net.

I have an asp.net application that is hosted on IIS 7.  This is configure to only enable Windows' authentication and I want to allow only a couple of AD user groups to have access to it.  It still ask for me to log in when I arrive at the site.  Is there a way to skip this authentication if the user is on the permitted list for the site if they already log in to the domain when they log on to their PC?  

Thank you.
0
Comment
Question by:lapucca
[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
  • 4
  • 4
8 Comments
 
LVL 12

Expert Comment

by:Ammar Gaffar
ID: 40523471
I do believe it is a client configuration at browser level, not server side. And again it depends on the browser itself, for IE you need to enable integrated Windows Authentication, you can find it in Tools > Internet Options > Advanced > Enable Integrated Windows Authentication, it needs to restart your client computer

Good Luck
0
 
LVL 12

Accepted Solution

by:
Ammar Gaffar earned 500 total points
ID: 40523480
Update to my above comment:

You need to choose Automatic logon with current username and password option, you can find it in

IE > Tools > Internet Options > Security Tab > Select Local Intranet Zone and press Custom Level Button> User Authentication > Automatic logon with current username and password
0
 

Author Comment

by:lapucca
ID: 40524173
Is there a way  to get the user credential when they first arrived at the web page if they're log in on  their PC and is already on our domain?  That way they would not need to log in again.  Also, the application only allows a few users to access it.  Should I store these users in the Web.config or the IIS?  And then check against the permitted users list?  Possible?
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 12

Expert Comment

by:Ammar Gaffar
ID: 40524283
Don't mix things,  you don't have issues in authentication,  so changing authentication methodology will not fix your main problem
As per my understanding,  you don't need the login popup appears when user is already logged in using domain account,  so keep focus in this point only
If you have few users then,  it is not difficult to configure their clients computers to auto login
0
 

Author Comment

by:lapucca
ID: 40524323
I don't know if that is possible with our company rules.  Let me check.  Somewhere I saw about using impersonation, how about that?  would that work?  Not sure how that would work either.  Thank you.

Also, would you recommend adding the allowed users in the web.config or in IIS?
0
 

Author Closing Comment

by:lapucca
ID: 40525043
Thank you
0
 
LVL 12

Expert Comment

by:Ammar Gaffar
ID: 40525050
Again, impersonation is something usually used after authentication.

Impersonation is used when you have some code required special permission, for example if you have function that accessing active directory, in this case special permission is required for the logged in user to access AD. In this case it is better to create a separate user for accessing active directory and impersonate this user in this function only, rather than assign AD permissions to your end users.

Allowed users, I recommend to have Active Directory Group specially for this application, and allow this group in your web.config. This is much better because managing users will be from active directory only

Good Luck
0
 

Author Comment

by:lapucca
ID: 40526285
Ammar,
BTW, I'm not using impersonation but what you said makes a lot of sense.  I bind AD using a service account so I don't have to impersonate.  

Thank you very much for such good advice.  Your advice and help is much appreciated.
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

710 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