You want to create the new Provider via code or you want the interface you need to write your own custom memebership provider?
We want to create a new Provider via code
Here is the documentation to create a custom membership provider. This will allow you to control how the provider functions and where it is stored. www.progress.com/.../tutorial-create-a-custom-membership-provider
Here is the documentation to create a custom membership provider. This will allow you to control how the provider functions and where it is stored. www.progress.com/.../tutorial-create-a-custom-membership-provider
But this information create a new membership provider complete. I need create one but the type "Telerik.Sitefinity.Security.Data.OpenAccessMembershipProvider, Telerik.Sitefinity"
I see what you are asking now, sorry I misunderstood your request. Below you will find an example of working with the SecurityConfig (memebership providers) below.
ConfigManager manager = ConfigManager.GetManager();//Get the config manager to work with the configurations using (ElevatedModeRegion elevatedModeRegion = new ElevatedModeRegion(manager))//Use this if you are running it during app bootstrap { SecurityConfig config = manager.GetSection<SecurityConfig>(); //Get the configuration file string name = "TestApi2"; //Set a name (unique) for the provider if (!config.MembershipProviders.ContainsKey(name)) //confirm it does not exist { Type providerType = typeof(Telerik.Sitefinity.Security.Data.OpenAccessMembershipProvider); //Get the provider type string providerTypeName = $"{providerType.FullName}, {providerType.Assembly.FullName}"; //Build the providertype name DataProviderSettings setting = new DataProviderSettings(config.MembershipProviders)//Build the provider setting to insert { ProviderTypeName = providerTypeName, Name = name }; config.MembershipProviders.Add(setting);//Add it to the membership provider setting manager.SaveSection(config); //save the configuration } }
Thanks!
This worked for me.
Thanks!
This worked for me.