Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i have an asp.net application that uses windows authentication.

i installed IIS server 5.1 on my xp machine and it works great with the win authorization; however, i am unable to use "roles" because for some reason it does not synchronize with the active directory and i dont know how to get it to synchronize.

do you know what kind of configuration/settings i need for IIS to synchronize with the AD? when i go into the Web Site Administration Tool and look at the roles and users in roles in shows me no users. i did create the security groups in AD and added users to them but i do not see them in the Web Site Administration Tool.

thanks so much for your guidance.

i am currently getting this error:

Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS1061: 'ASP.default_aspx' does not contain a definition for 'SqlDataSource1_Selecting' and no extension method 'SqlDataSource1_Selecting' accepting a first argument of type 'ASP.default_aspx' could be found (are you missing a using directive or an assembly reference?) Source Error: Line 143: </ItemTemplate> Line 144: – I__ 12 mins ago 
</asp:FormView> Line 145: <asp:SqlDataSource ID="SqlDataSource1" runat="server" Line 146: ConnectionString="<%$ ConnectionStrings:qcvalues_testConnectionString %>" Line 147: SelectCommand="SELECT * FROM [batchinfo]" Source File: c:\Documents and Settings\agordon\My Documents\Visual Studio 2008\Projects\EnterData\EnterData\Default.aspx Line: 145 – I__

i did follow joel's advice and did this:

<roleManager enabled="true"
             defaultProvider="AspNetWindowsTokenRoleProvider"/>
share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

If you've gotten Windows Authentication to work then the connection to the active directory is working just fine. The configuration point that you're probably missing is the roles provider that belongs in the web.config:

<roleManager enabled="true"
             defaultProvider="AspNetWindowsTokenRoleProvider"/>

This should also give you immediate access to the groups a user is a member of through the roles by calling the following methods:

User.IsInRole
Roles.IsUserInRole

Here is the MSDN article that discusses the incorporation of windows authentication into an asp.net site "out of the box".

http://msdn.microsoft.com/en-us/library/ff647405.aspx

share|improve this answer
    
when i made that role change i got this error: Web Site Administration Tool How do I Use this Tool An error was encountered. Please return to the previous page and try again. The following message may help in diagnosing the problem: The configured Role Provider (WindowsTokenRoleProvider) relies upon Windows authentication to determine the groups that the user is allowed to be a member of. ASP.NET Role Manager cannot be used to manage Windows users and groups. Please use the SQLRoleProvider if you would like to support custom user/role assignment. at –  Yuck Aug 23 '11 at 15:27
    
System.Web.Administration.WebAdminPage.CallWebAdminHelperMethod(Boolean isMembership, String methodName, Object[] parameters, Type[] paramTypes) at ASP.security_roles_manageallroles_aspx.BindGrid() at ASP.security_roles_manageallroles_aspx.Page_Load() at System.Web.Util.CalliHelper.ArglessFunctionCaller(IntPtr fp, Object o) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, –  Yuck Aug 23 '11 at 15:28
    
btw i really appreciate your help –  Yuck Aug 23 '11 at 15:28
    
@I__: This sounds very much like you have not properly configured the site for windows authentication. It may be behaving as you expect, but that does not ensure a proper configuration. At this point, the only thing I can really recommend is that you take your configuration back to the basics, starting with your <authentication> tag. If you look at the link I referenced, it should be almost a step-by-step basic configuration. –  Joel Etherton Aug 23 '11 at 15:50
    
actually i did what you said and things are working better however now i am getting this error: –  Yuck Aug 23 '11 at 15:54
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.