LdapRoleProvider GetRolesForUser bug?I have configured the standard LDAPRoleProvider to access a Sun Java SunOne LDAP according to the following document:<br>( <a href="http://msdn.microsoft.com/en-us/library/bb977430.aspx#MOSSFBAPart3_UsingLDAPProvider">http://msdn.microsoft.com/en-us/library/bb977430.aspx#MOSSFBAPart3_UsingLDAPProvider</a> )<br><br>I am able to login via the membership provider and select roles from the role provider.  The problem is that it does not recognize which users are in the LDAP groups.  I coded a usercontrol to output the role provider's GetUsersInRole, IsUserInRole, and GetRolesForUser methods.  The GetUsersInRole works successfully (listing the test users), but the latter methods return false and 0 results respectively.  Has anyone successfully used the LdapRoleProvider?<br><br>Any help would be greatly appreciated.<br><br>Thank you,<br>Robert Freeman<hr class="sig">RobertRFreeman© 2009 Microsoft Corporation. All rights reserved.Wed, 18 Feb 2009 02:40:10 Z0e877951-0b11-4e12-8c65-1d3fe4aec64fhttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/0e877951-0b11-4e12-8c65-1d3fe4aec64f#0e877951-0b11-4e12-8c65-1d3fe4aec64fhttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/0e877951-0b11-4e12-8c65-1d3fe4aec64f#0e877951-0b11-4e12-8c65-1d3fe4aec64fRobertRFreemanhttp://social.msdn.microsoft.com/Profile/en-US/?user=RobertRFreemanLdapRoleProvider GetRolesForUser bug?I have configured the standard LDAPRoleProvider to access a Sun Java SunOne LDAP according to the following document:<br>( <a href="http://msdn.microsoft.com/en-us/library/bb977430.aspx#MOSSFBAPart3_UsingLDAPProvider">http://msdn.microsoft.com/en-us/library/bb977430.aspx#MOSSFBAPart3_UsingLDAPProvider</a> )<br><br>I am able to login via the membership provider and select roles from the role provider.  The problem is that it does not recognize which users are in the LDAP groups.  I coded a usercontrol to output the role provider's GetUsersInRole, IsUserInRole, and GetRolesForUser methods.  The GetUsersInRole works successfully (listing the test users), but the latter methods return false and 0 results respectively.  Has anyone successfully used the LdapRoleProvider?<br><br>Any help would be greatly appreciated.<br><br>Thank you,<br>Robert Freeman<hr class="sig">RobertRFreemanTue, 13 Jan 2009 20:14:45 Z2009-01-13T20:14:45Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/0e877951-0b11-4e12-8c65-1d3fe4aec64f#430fbd24-93e2-4f87-9b84-519228cb897ahttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/0e877951-0b11-4e12-8c65-1d3fe4aec64f#430fbd24-93e2-4f87-9b84-519228cb897aRobertRFreemanhttp://social.msdn.microsoft.com/Profile/en-US/?user=RobertRFreemanLdapRoleProvider GetRolesForUser bug? I found a solution to this issue and posted it in the community content on the source article above.<br>I will post it here as well:<br><br> <table cellspacing=0 cellpadding=0 width="100%"> <tbody> <tr> <td align=left><span class="CCI_Header_Title"><b><font size=4>Using LDAPRoleProvider with Sun Java Directory Server</font></b></span></td> <td><span class="CCI_Header_Spacer">    </span> </td> <td class="CCI_Header_Actions" align=right> </td></tr></tbody></table> <div class="CCI_Text" style="cursor:default"> <div> <div class=" CCE_Editor_Disabled" title="" style="width:auto;height:auto"> <div style=""> <p>When configuring Sun Java Directory Server LDAPRoleProvider, the userContainer is also required if the uniqueMember attribute contains the full DN.</p> <p>This would be the correct config section (Same as above with the userContainer):<br><br>&lt;roleManager defaultProvider=&quot;myorgGroup&quot; enabled=&quot;true&quot; cacheRolesInCookie=&quot;false&quot; cookieName=&quot;.PeopleDCRole&quot; &gt;<br>&lt;providers&gt;<br>&lt;add <br>name=&quot;myorgGroup&quot; <br>type=&quot;Microsoft.Office.Server.Security.LDAPRoleProvider, <br>Microsoft.Office.Server, Version=12.0.0.0, Culture=neutral, <br>PublicKeyToken=71E9BCE111E9429C&quot; <br>server=&quot;SunDirectoryServer.myorg.net&quot; <br>port=&quot;389&quot; <br>useSSL=&quot;false&quot; <br>groupContainer=&quot;ou=groups,o=myorg,c=us&quot; <br>groupNameAttribute=&quot;cn&quot;<br>groupMemberAttribute=&quot;uniqueMember&quot;<br><b>userContainer=&quot;ou=people,o=myorg,c=us&quot;<br></b>userNameAttribute=&quot;uid&quot; <br>dnAttribute=&quot;entryDN&quot; <br>groupFilter=&quot;(ObjectClass=groupofuniquenames)&quot; <br>scope=&quot;Subtree&quot; <br>/&gt;<br>&lt;/providers&gt;<br>&lt;/roleManager&gt;</div> <div class="CCT_FlagAsPanel" style=""> </div></p></div></div></div> <div class="CCI_Container"> <div class="CCI_Header"> <table cellspacing=0 cellpadding=0 width="100%"> <tbody> <tr> <td align=left><span class="CCI_Header_Title"><b><font size=4>Debugging Ldap Configuration</font></b></span></td> <td><span class="CCI_Header_Spacer">    </span> </td> <td class="CCI_Header_Actions" align=right> </td></tr></tbody></table></div> <div class="CCI_Text" style="cursor:default"> <div> <div class=" CCE_Editor_Disabled" title="" style="width:auto;height:auto"> <div style="">When debugging your ldap configuration section, here are 2 must-have (free) tools:<br> <ol> <li>Softerra Ldap Browser (<a href="http://www.softerra.com/download.htm">http://www.softerra.com/download.htm</a>)</li> <ol> <li>Will allow you to easily browse the LDAP structure and test filter and baseDN settings</li></ol> <li>Microsoft Network Monitor (<a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=f4db40af-1e08-4a21-a26b-ec2f4dc4190d&amp;DisplayLang=en">http://www.microsoft.com/downloads/details.aspx?FamilyID=f4db40af-1e08-4a21-a26b-ec2f4dc4190d&amp;DisplayLang=en</a>)</li> <ol> <li>Used to monitor the ldap calls to and from sharePoint.</li> <li>Configure the monitor on your SharePoint server as follows (Swap out LdapServerIP)</li> <li>Don't forget to apply each filter before clicking run</li></ol></ol> <p><b>Capture Filter:</b><br>// Show only LDAP frames<br>TCP.Port == 389 or UDP.Port == 389<br>and<br>IPV4.DestinationAddress == LdapServerIP<br>or<br>IPV4.SourceAddress == LdapServerIP<br>and <br>TCP.Port == 389 or UDP.Port == 389</p><br><b>Display Filter:<br></b>//LDAP<br>LDAP</div></div></div></div></div><hr class="sig">RobertRFreemanWed, 18 Feb 2009 02:29:06 Z2009-02-18T02:29:06Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/0e877951-0b11-4e12-8c65-1d3fe4aec64f#e15ebbbf-ddec-4e45-90fd-934f78babb2dhttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/0e877951-0b11-4e12-8c65-1d3fe4aec64f#e15ebbbf-ddec-4e45-90fd-934f78babb2dRobertRFreemanhttp://social.msdn.microsoft.com/Profile/en-US/?user=RobertRFreemanLdapRoleProvider GetRolesForUser bug? Here are some details on the issue:<br><br>The group LDAP query filter without the userContainer would look like this:<br><strong>(uid=sharepttest)</strong><br><br>With the userContainer the correct filter is:<br><strong>(&amp;(ObjectClass=groupofuniquenames)(uniqueMember=uid=sharepttest,ou=people,o=myorg,c=us))<br></strong><br><br>Note that the prior filter has 2 issues.  <br> <ol> <li>It does not mention the uniqueMember attribute.</li> <li>It does not include the fully qualified DN</li></ol> <p>Hope this helps someone else. :)</p><hr class="sig">RobertRFreemanWed, 18 Feb 2009 02:40:07 Z2009-02-18T02:40:07Z