Solved

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

Posted on 2014-12-29
8
324 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
PowerShell Core for Advanced Linux Administrators

Understand advanced principals around Powershell Core with a focus on the Linux Administrator.  This course covers how to administer numerous environments across multiple platforms including Linux, Azure, AWS, and Google Cloud from a single shell instance.

 
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

How To Install Bash on Windows 10

Windows’ budding partnership with Canonical has certainly led to some great improvements. One of them being the ability to use Bash on your Windows machine without third party applications! This might be one of the greatest things a cloud engineer in a Windows environment can do!

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

623 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