CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.security Tags:
Item Type: NewsGroup Date Entered: 3/19/2008 2:19:50 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 21 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
worldcrafter
Asp.Net User
Windows authentication/authorization: How to allow ONLY one type of group/role to enter website?3/19/2008 2:19:50 AM

0/0

I'm trying to figure out how to allow only a single active directory role/group to access an intranet website that I'm creating.  It is a trouble ticketing site, and I only want employees who are in the CallTrackingSystemUsers Windows group to be able to access this site.  I am using windows authentication, and AspNetWindowsTokenRoleProvider for role management.  In my web.config file, I have the following (MyDomain is the windows 2003 domain I'm working in):

      <authentication mode="Windows" />

      <authorization>       
        <deny users="?"/>       
        <allow roles="MyDomain\CallTrackingSystemUsers" />       
      </authorization>

 The above denies anonymous access to the website, and I also figured that it would only allow Windows users in the group CallTrackingSystemUsers to log into the site, but it is also allowing other Windows AD users (who are NOT in the group CallTrackingSystemUsers) to log in as well.

 I would like to know if there is a simple solution for allowing ONLY users in the windows active directory group CallTrackingSystemUsers to access the website.  I don't want any Windows users to access the website unless they are in the CallTrackingSystemUsers group.

 The current solution I have is to redirect users to an error page if they are not in the CallTrackingSystemUsers group.  I check for this in the Page_Load event:

 if (!User.IsInRole("MyDomain\\CallTrackingSystemUsers"))
        {           
            Response.Redirect("error.aspx");        
        }

I have to insert the above code into every page on my website.  There has to be a better solution than this in asp.net... help?

ramblor
Asp.Net User
Re: Windows authentication/authorization: How to allow ONLY one type of group/role to enter website?3/19/2008 8:58:57 AM

0/0

Try adding an extra element to your authorization section: 

  <authorization>       
        <deny users="?"/>       
        <allow roles="MyDomain\CallTrackingSystemUsers" />
        <deny users="*" />
</authorization>

 


Sometimes I think my posts are invisible :(
worldcrafter
Asp.Net User
Re: Windows authentication/authorization: How to allow ONLY one type of group/role to enter website?3/19/2008 6:55:38 PM

0/0

wow great, thanks ramblor!  works perfectly... originally i tried the code below, but it denied all access to the website:

 <authorization>       
        <deny users="?"/>        
        <deny users="*" />
        <allow roles="MyDomain\CallTrackingSystemUsers" />
</authorization>

I see now that it makes a big difference where the authorization statements are placed. Yes

Annddrew
Asp.Net User
Re: Windows authentication/authorization: How to allow ONLY one type of group/role to enter website?3/19/2008 7:04:40 PM

0/0

The following statement should be enough:

<authorization>           
                <allow roles="MyDomain\CallTrackingSystemUsers" />

               <deny users="*" />
</authorization>

4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Best Damn Windows Server 2003 Book Period: Everything You Need ToKnow About Managing A Windows Server 2003 Enterprise Authors: Susan Snedaker, Thomas W. Shinder, Debra Littlejohn Shinder, Pages: 997, Published: 2004

Web:
MSDN Windows Communication Foundation Windows Authentication and ... Windows Authentication and Authorization. ... and in Order 2 he/she can be just viewer... here Order is a form type] .. how do we assign roles dynamically. ...
Wrox Article : ASP.NET 3.5 Windows-Based Authentication - Wrox NET authentication, one of several different types of authentication measures ASP .... Recipe: Enabling Windows Authentication within an Intranet ASP.NET ... NET's Membership, Roles, and Profile functionality using Windows Authentication? I challenge you to find a website that talks about this. I've only seen ...
Authentication, Authorization, and Access Control This is handled using authentication groups. An authentication group is, ... So, when you visit the same web site again, you will need to re-enter your ...
Flex Wiki2 Secure Admin Full Windows Authentication is only possible on a Windows 2003 Server, Windows 2008 .... Notes from a dark corner : ASP.NET - Windows authentication and ... Jul 27, 2006 ... ... Therefore, if the user is added to a local group between one request and the ...
Authorization Manager and Role-Based Administration in Windows ... You can select one of two types of authorization stores: ... Although Windows group accounts (and user and computer accounts) are used in Authorization ...
Joshua Flanagan - HttpModule to allow a custom error page for ... By default in a Windows Authentication/NTLM scenario, the roles map to the group ... ...
Access to Lansweeper by group membership - Lansweeper ... Integrated Windows authentication must be enabled Thanks for this post . ... Line 14: Line 15: ...
ASP.NET security - TechSpace - Express Computer India Let us discuss them one by one. Windows authentication. This type of ... In almost all situations we will allow anonymous access to our website, ...




Search This Site:










can we call c language functions in .net

asp.net component in asp classic?

importing document

how can i get the name of a textbox when using master pages?

querystring error

cannot remove blocked cookie on localhost

sharing of the manage user function in admin panel.

using hashpasswordforstoringinconfigfile

display session key in global function/subroutine

can you please calrify code behind declarative statement

eval expression to display different data

asp and aspx pages sharing access database?

could this be done with nested classes, or am i barking up the wrong tree

menu control

moveing iframe

object expected error menu control

destroy cookies when logoff

custom module : multiple view controls

first record issue

how to report a bug

setting maximum length on a multiline textbox

how to set imageurl to a file another drive in onclick event?

imagebutton commandargument problems

can´t load the module dotnetnuke.cdefault

retrieve previous page url

ie web controls: toolbar - how can i use buttonclick event?

making a parent a child or vice versa

mypanel.controls.add issues

reg. asp.net resource kit

where is the community???

 
All Times Are GMT