Custom membershipprovider without Guid

Posted by Community Admin on 04-Aug-2018 09:15

Custom membershipprovider without Guid

All Replies

Posted by Community Admin on 13-May-2011 00:00

I'm using Sitefinity 4.1. I'm writing my own custom asp.net membership provider with an existing database. This existing database doesn't have a Guid for identifying each record. I just implemented the GetallUsers method. When I return an empty MembershipUserCollection it works. If return a filled MembershipUserCollection I get an exception on the login page: 

[FormatException: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).]
   System.Guid.TryParseGuidWithNoStyle(String guidString, GuidResult& result) +3916597
   System.Guid.TryParseGuid(String g, GuidStyles flags, GuidResult& result) +245
   System.Guid.Parse(String input) +73
   Telerik.Sitefinity.Security.UserWrapper.CopyFrom(MembershipUser user, String applicationName) +140
   Telerik.Sitefinity.Security.MembershipProviderWrapper.GetUsers() +196
   Telerik.Sitefinity.Security.Web.UI.LoginForm.InitializeProvidersList() +366
   Telerik.Sitefinity.Security.Web.UI.LoginForm.CreateChildControls() +116
   System.Web.UI.Control.EnsureChildControls() +102
   System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +20
   System.Web.UI.Control.FindControl(String id) +12
   Telerik.Sitefinity.Security.Web.UI.LoginForm.get_ChangePasswordLink() +30
   Telerik.Sitefinity.Security.Web.UI.LoginForm.UpdateVisibilityOfLinks() +121
   Telerik.Sitefinity.Security.Web.UI.LoginForm.set_ShowChangePasswordLink(Boolean value) +60
   Telerik.Sitefinity.Web.LoginRouteHandler.SetLoginLogoutFroms(Page handler, RequestContext requestContext, String view) +289
   Telerik.Sitefinity.Web.LoginRouteHandler.InitializeHttpHandler(Page handler, RequestContext requestContext) +202
   Telerik.Sitefinity.Web.RouteHandlerBase.Handler_PreInit(Object sender, EventArgs e) +199
   System.Web.UI.Page.OnPreInit(EventArgs e) +8897726
   System.Web.UI.Page.PerformPreInit() +31
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +328

I'd gues the Sitefinity security wrapper expects the ProviderUserKey to be a Guid which isn't the case. Or am I doing something wrong here?

Posted by Community Admin on 13-May-2011 00:00

Hello El Barto,

Yes, we expect guids. You can create some Guid mapper in your custom database, so you can use your users with Sitefinity.

Kind regards,
Ivan Dimitrov
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 13-May-2011 00:00

Hi Ivan,

Thanks for the response.
I'm sure Telerik has it's reasons for choosing only to support Guid's but it limits the flexibility of the membershipprovider. I think that's unfortunate.

Regards,

Bart

Posted by Community Admin on 13-May-2011 00:00

Hi El Barto,

In the SqlMembershipProvider the unique identifier is also supposed to be a guid or you should cast the value to guid.

Greetings,
Ivan Dimitrov
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed