Does anyone know if there's a way to manage users/roles in the asp.net membership database using a web-based interface you can access remotely?
I need one which doesn't require installation to the Default Website.
Thanks
There is a great article here.
with samples of how to implement the aspnet membership database through webservices.
Download asp.net example from here
For the downloaded example using SQL express for local testing, I struggeled a little bit, but found a solution:
In web.confing:
<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data Source=name of the local machine\SQLEXPRESS;Initial Catalog=ASPNETDB;Integrated Security=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
Here is a quick and dirty solution. Copy your ASP.NETWebAdminFiles to a directory on your server. Make it a virtual directory. Open up the App_Code/WebAdminPage.cs file and coment out lines around 488 - 495 the code will look like this:
// Changed by Jason so I can use this remotely!!!
// if (!application.Context.Request.IsLocal) {
// SecurityException securityException = new SecurityException((string)HttpContext.GetGlobalResourceObject("GlobalResources", "WebAdmin_ConfigurationIsLocalOnly"));
// WebAdminPage.SetCurrentException(application.Context, securityException);
// application.Server.Transfer("~/error.aspx");
// }
Then you can now use this tool remotely. Just user your browser to pull up the newly created virtual directory passing in the correct parameters. For example
http://myservername/WebAdminFiles/default.aspx?applicationPhysicalPath=C:\Websites\Application\&applicationUrl=/ApplicationURL
The other thing I did was to enable windows authentication on this folder so that I have to have an admin account on the server before I can access this url. This is important because once you enable this tool anyone can browse and delete users if they pull up the url.
I just modify the connection string in my local web.config on the development version of my site to point to the remote database and then from within Visual Studio went to:
Project | ASP.NET Configuration
This opened up the local configuration site but talking to the remote database, allowing me to manage users/roles etc from there.
Obviously this assumes that you have a database server to connect to rather than the file based setup in APP_DATA.