Solved

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

Posted on 2014-12-29
8
307 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
 
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now