1

Implementing custom membership provider in SharePoint 2010 I am getting the following error.

I am getting this error in the following page: http://home:55555/_admin/WebApplicationList.aspx

I copy the membership code in 3 web.config file.
1. My Current Web Application.
2. Central administration.
3. Security Token Web service.

<membership defaultProvider="i">
      <providers>
        <add name="i" type="Microsoft.SharePoint.Administration.Claims.SPClaimsAuthMembershipProvider, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
        <add name="CustomFBAMembership" type="CustomMemberShipProvider.Class.CustomMemberShip,CustomMemberShipProvider,  Version=1.0.0.0, Culture=neutral, PublicKeyToken=99f33d5f328d7f5a"/>
      </providers>
    </membership>
    <roleManager defaultProvider="c" enabled="true" cacheRolesInCookie="false">
      <providers>
        <add name="c" type="Microsoft.SharePoint.Administration.Claims.SPClaimsAuthRoleProvider, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
        <add name="CustomFBARole" type="CustomMemberShipProvider.Class.CustomRoleBase, CustomMemberShipProvider,  Version=1.0.0.0, Culture=neutral, PublicKeyToken=99f33d5f328d7f5a"/>
      </providers>
    </roleManager> 

Error

Exception of type 'System.ArgumentException' was thrown. Parameter name: encodedValue

Troubleshoot issues with Microsoft SharePoint Foundation.

FYI : When I am comment out the all membership and rolemanager tags from the Central Administration site web.config then it's working fine. I think the problem is somewhere in the membership provider tags.

Please help me out this problem. Thanks

3
  • If you think your tags are the issue. Then try adding them using IIS.
    – Shoban
    May 30, 2011 at 7:06
  • Hi did you ever resolve this issue? I am struggling with kind of the same error. Sander
    – user10546
    Sep 5, 2012 at 21:11
  • I am getting the same problem. Did anyone resolve that ?? Please help Sep 19, 2014 at 13:20

2 Answers 2

4

I think that the 3 web config will need to be configured differently eg

This for your FBA Site

<membership defaultProvider="i">
  <providers>
    <add name="i" type="Microsoft.SharePoint.Administration.Claims.SPClaimsAuthMembershipProvider, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
    <add name="CustomFBAMembership" type="CustomMemberShipProvider.Class.CustomMemberShip,CustomMemberShipProvider,  Version=1.0.0.0, Culture=neutral, PublicKeyToken=99f33d5f328d7f5a"/>
  </providers>
</membership>
<roleManager defaultProvider="c" enabled="true" cacheRolesInCookie="false">
  <providers>
    <add name="c" type="Microsoft.SharePoint.Administration.Claims.SPClaimsAuthRoleProvider, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
    <add name="CustomFBARole" type="CustomMemberShipProvider.Class.CustomRoleBase, CustomMemberShipProvider,  Version=1.0.0.0, Culture=neutral, PublicKeyToken=99f33d5f328d7f5a"/>
  </providers>
</roleManager> 

This for the token and central admin

    <membership defaultProvider="i">
  <providers>
    <add name="CustomFBAMembership" type="CustomMemberShipProvider.Class.CustomMemberShip,CustomMemberShipProvider,  Version=1.0.0.0, Culture=neutral, PublicKeyToken=99f33d5f328d7f5a"/>
  </providers>
</membership>
<roleManager>
  <providers>
    <add name="CustomFBARole" type="CustomMemberShipProvider.Class.CustomRoleBase, CustomMemberShipProvider,  Version=1.0.0.0, Culture=neutral, PublicKeyToken=99f33d5f328d7f5a"/>
  </providers>
</roleManager>
0

Try to debug your code. It is likely in issue with your custom membership provider, since it works when you remove it from the web.config. When it is added to the web.config your membership provider is initialised. Also check the ULS log for a stack trace, which likely will pin down your problem.

2
  • can you please provide me some good links so i can Implement the Custom Membership provider on my site. May 30, 2011 at 6:36
  • when I remove the role Provider from my Central Administration Site. Then I try to check the custom provider. It works for me. But my question is this why RoleProvider not working in SharePoint 2010? May 30, 2011 at 7:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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