Forms Authentication - Admin Pages Outside of VS?

Discussion in 'ASP .Net Security' started by Scott Townsend, Jun 4, 2007.

  1. 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
    Scott Townsend, Jun 4, 2007
    #1
    1. Advertising

  2. 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)

    > 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, Jun 4, 2007
    #2
    1. Advertising

  3. 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.netwebad...t-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:...
    > 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)
    >
    >> 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
    >>

    >
    >
    Scott Townsend, Jun 5, 2007
    #3
  4. 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)

    > 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?applicationPh
    > ysicalPath=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(Str
    > ing& 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.Syste
    > m.Configuration.Internal.IInternalConfigConfigurationFactory.Create(Ty
    > pe typeConfigHost, Object[] hostInitConfigurationParams) at
    > System.Web.Configuration.WebConfigurationHost.OpenConfiguration(WebLev
    > el webLevel, ConfigurationFileMap fileMap, VirtualPath path, String
    > site, String locationSubPath, String server, String userName, String
    > password, IntPtr tokenHandle) at
    > System.Web.Configuration.WebConfigurationManager.OpenMappedWebConfigur
    > ation(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\A
    > pp_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\A
    > pp_Code\WebAdminPage.cs:line 325 at
    > System.Web.Administration.WebAdminPage.OpenWebConfiguration(String
    > path) in
    > c:\WINDOWS\microsoft.net\Framework64\v2.0.50727\ASP.NETWebAdminFiles\A
    > pp_Code\WebAdminPage.cs:line 320 at
    > System.Web.Administration.WebAdminPage.VerifyAppValid() in
    > c:\WINDOWS\microsoft.net\Framework64\v2.0.50727\ASP.NETWebAdminFiles\A
    > pp_Code\WebAdminPage.cs:line 446
    >
    > Thanks,
    >
    > "Dominick Baier" <dbaier@pleasepleasenospam_leastprivilege.com> wrote
    > in message news:...
    >
    >> 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)
    >>
    >>> 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, Jun 5, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eric
    Replies:
    2
    Views:
    1,449
    Tommy
    Feb 13, 2004
  2. sarah Fernandes
    Replies:
    0
    Views:
    492
    sarah Fernandes
    Nov 1, 2010
  3. Eric
    Replies:
    2
    Views:
    484
  4. Phlip
    Replies:
    1
    Views:
    281
    Eero Saynatkari
    Sep 15, 2006
  5. Krzysztof Poc

    outside type, outside function

    Krzysztof Poc, Feb 3, 2012, in forum: C++
    Replies:
    1
    Views:
    282
    Victor Bazarov
    Feb 7, 2012
Loading...

Share This Page