Custom Membership- & RoleProvider
Hello,
We're trying to integrate our CRM system with a new Sitefinity Portal. We would like to be able to use the Custom Membership & Roleprovider in Sitefinity we've written in our CRM system.
For this scenario, I've studied this page: www.sitefinity.com/.../choosing-the-provider-options
We would like to implement the case 2 scenario. I've successfully connected the membership provider. I can login using our membership provider.
We would like to be able to use our roles and grant access to specific pages to these roles using our custom Role Provider. Therefor, I've enabled the RoleManager in the web.config and added our roleprovider:
<
roleManager
enabled
=
"true"
>
<
providers
>
<
add
name
=
"GfhRoleProvider"
type
=
"Gfh.Membership.GfhRoleProvider, Gfh.Membership"
/>
</
providers
>
</
roleManager
>
Any suggestions? See attachment for a complete stack trace.
Kind regards,
Mark
Hi Mark,
It looks like a database connection issue. It seems that the RoleProvider isn't aware of the fact it uses a different database. Maybe you can post the code of the RoleProvider? Or sent it by mail ;)
Do you inherit the specific Sitefinity RoleDataProvider class, or the one from ASP.NET itself?
Best,
Daniel
Hi,
The RoleProvider is just a mockup for now, but I would like to inherit from the System.Web.Security.RoleProvider, for reusability reasons.
It's not my Custom RoleProvider where the error comes from, see the stack trace. The error is generated by System.Web.Security.SqlRoleProvider.GetAllRoles()
Kind Regards,
Mark
Found the solution, with some help from Telerik support: I missed the defaultProvider attribute in the Rolemanager element in the web.config:
<roleManager enabled="true" defaultProvider="GfhRoleProvider">
That did the trick.