Solved

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

Posted on 2014-12-29
8
318 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
  • 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

820 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