Groups | Blog | Home
all groups > asp.net security > june 2007 >

asp.net security : Forms Authentication - Admin Pages Outside of VS?



Scott Townsend
6/4/2007 2:14:26 PM
Okay so I'm somwhat new to ASP.Net and Visual Studio. We've installed
WindoesSharepoint Services 3 on our server and have it configured to use
Forms Based Authentication. I've gone in VS and created the ASP.Net app and
then clicked the Website, ASP.Net Configuration Menu option and it brings up
the Screens to allow me to Add Users to the DB, create groups, and all that
fun stuff.

My Copy of Visual Studio is in a Virtual Machine and its a Pain to have to
load it up every time I want to Add or edit a user.


Can I just make a Virtual Directory to the
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ASP.NETWebAdminFiles folder
and run it from another Web instead of inside Visual Studio?

Where would I put:
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="<..snip..>" />
<remove name="AspNetSqlProvider" />
<add name="AspNetSqlProvider" connectionString="<..snip..>" />
</connectionStrings>

and the other studd in the web.config.

Thanks
Dominick Baier
6/4/2007 9:28:05 PM
Well - this kind of works - but is not supported.

a) have a look at the query strings they pass into the admin page - basically
the virtual and physical path of the app you want to configure
b) the provider settings are read from the app you want to configure
c) in addition - there is a check in the source to only allow connection
from localhost - you would have to remove that check.

as i said - it is not supported ;)


-----
Dominick Baier (http://www.leastprivilege.com)

Developing More Secure Microsoft ASP.NET 2.0 Applications (http://www.microsoft.com/mspress/books/9989.asp)

[quoted text, click to view]

Scott Townsend
6/5/2007 6:15:29 AM
So how else are you supposed to be able to add and maintain users? I guess
you are supposed to create your own pages?

So I've linked in the pages. put in the URL of:
http://localhost:27268/asp.netwebadminfiles/default.aspx?applicationPhysicalPath=D:\Inetpub\Webs\ASP.Net-WebAdmin\website1\&applicationUrl=/website1

I've published the web.config file from the VS App to the
D:\Inetpub\Webs\ASP.Net-WebAdmin\website1 directory

The thing I'mnot sure of is the Application URL. On the VS machine there
are 2 Webs running, one is the Webadmin files on port 1686 and the webapp on
1233. So how does the asp.netwebadmin files know that the Application web
is on a different port? Is it always on 1233?


So when I put in the URL I get the Following, so something isn't right in
the URL or the placement of the files.

An error was encountered. Please return to the previous page and try again.

The following message may help in diagnosing the problem:
System.ArgumentOutOfRangeException: Specified argument was out of the range
of valid values. Parameter name: site at
System.Web.Configuration.WebConfigurationHost.InitForConfiguration(String&
locationSubPath, String& configPath, String& locationConfigPath,
IInternalConfigRoot configRoot, Object[] hostInitConfigurationParams) at
System.Configuration.Configuration..ctor(String locationSubPath, Type
typeConfigHost, Object[] hostInitConfigurationParams) at
System.Configuration.Internal.InternalConfigConfigurationFactory.System.Configuration.Internal.IInternalConfigConfigurationFactory.Create(Type
typeConfigHost, Object[] hostInitConfigurationParams) at
System.Web.Configuration.WebConfigurationHost.OpenConfiguration(WebLevel
webLevel, ConfigurationFileMap fileMap, VirtualPath path, String site,
String locationSubPath, String server, String userName, String password,
IntPtr tokenHandle) at
System.Web.Configuration.WebConfigurationManager.OpenMappedWebConfiguration(WebConfigurationFileMap
fileMap, String path) at
System.Web.Administration.WebAdminPage.OpenWebConfiguration(String path,
String appPhysPath, Boolean getWebConfigForSubDir) in
c:\WINDOWS\microsoft.net\Framework64\v2.0.50727\ASP.NETWebAdminFiles\App_Code\WebAdminPage.cs:line
345 at System.Web.Administration.WebAdminPage.OpenWebConfiguration(String
path, Boolean getWebConfigForSubDir) in
c:\WINDOWS\microsoft.net\Framework64\v2.0.50727\ASP.NETWebAdminFiles\App_Code\WebAdminPage.cs:line
325 at System.Web.Administration.WebAdminPage.OpenWebConfiguration(String
path) in
c:\WINDOWS\microsoft.net\Framework64\v2.0.50727\ASP.NETWebAdminFiles\App_Code\WebAdminPage.cs:line
320 at System.Web.Administration.WebAdminPage.VerifyAppValid() in
c:\WINDOWS\microsoft.net\Framework64\v2.0.50727\ASP.NETWebAdminFiles\App_Code\WebAdminPage.cs:line
446

Thanks,

"Dominick Baier" <dbaier@pleasepleasenospam_leastprivilege.com> wrote in
message news:51eb3048112968c9751723247913@news.microsoft.com...
[quoted text, click to view]
Dominick Baier
6/5/2007 4:04:36 PM
I once tried it and it kinda worked But i can't remember the details. sorry.


-----
Dominick Baier (http://www.leastprivilege.com)

Developing More Secure Microsoft ASP.NET 2.0 Applications (http://www.microsoft.com/mspress/books/9989.asp)

[quoted text, click to view]

AddThis Social Bookmark Button