Avatar of lapucca
lapucca

asked on 

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

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.
C#.NET ProgrammingASP.NET

Avatar of undefined
Last Comment
lapucca
Avatar of Ammar Gaffar
Ammar Gaffar
Flag of United Arab Emirates image

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
ASKER CERTIFIED SOLUTION
Avatar of Ammar Gaffar
Ammar Gaffar
Flag of United Arab Emirates image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of lapucca
lapucca

ASKER

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?
Avatar of Ammar Gaffar
Ammar Gaffar
Flag of United Arab Emirates image

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
Avatar of lapucca
lapucca

ASKER

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?
Avatar of lapucca
lapucca

ASKER

Thank you
Avatar of Ammar Gaffar
Ammar Gaffar
Flag of United Arab Emirates image

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
Avatar of lapucca
lapucca

ASKER

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.
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo