- #1
T
TiloS
Neues Mitglied
Themenersteller
- Dabei seit
- 13.10.2011
- Beiträge
- 4
- Reaktionspunkte
- 0
Hallo,
ich möchte innerhalb unserer Webseite den Downloadbereich (alle Dateien in allen Unterverzeichnissen) mit einer Forms authentication mit Benutzername und Passwort schützen. Für Aspx-Seiten geht das in der web.config relativ einfach. Aber für statische Dateien bekomme ich es einfach nicht hin.
Ich habe dazu den Download-Ordner im IIS in eine Anwendung konvertiert und in der web.config versucht die statische Dateien einzubinden.
<?xml version=1.0 encoding=UTF-8?>
<configuration>
<system.webserver>
<handlers>
<!-- classic mode .htm handler to make asp.net handle .htm requests -->
&l<add name=HtmlHandler-Classic path=*.* verb=GET,HEAD,POST,DEBUG modules=IsapiModule scriptProcessor=C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll requireAccess=Script preCondition=classicMode,runtimeVersionv4.0,bitness64></add>
<!-- integrated pipeline mode handler to make asp.net handle .htm requests -->
<add name=HtmlHandler-Integrated path=*.* verb=GET,HEAD,POST,DEBUG modules=ManagedPipelineHandler requireAccess=Script preCondition=integratedMode type=System.Web.UI.PageHandlerFactory> </add>
</handlers>
</system.webserver>
<system.webServer>
<modules>
<remove name=FormsAuthenticationModule />
<add name=FormsAuthenticationModule type=System.Web.Security.FormsAuthenticationModule />
<remove name=UrlAuthorization />
<add name=UrlAuthorization type=System.Web.Security.UrlAuthorizationModule />
<remove name=DefaultAuthentication />
<add name=DefaultAuthentication type=System.Web.Security.DefaultAuthenticationModule />
</modules>
</system.webServer>
<system.web>
<authentication mode=Forms>
<forms loginUrl=logon.aspx name=.ASPXFORMSAUTH>
<credentials passwordFormat=Clear>
<user name=test1 password=test1 />
<user name=test2 password=test2 />
<user name=test3 password=test3 />
</credentials>
</forms>
</authentication>
<authorization>
<deny users=? />
</authorization>
<customErrors mode=Off />
</system.web>
<appSettings file=*.* />
</configuration>
Mit diesen Angaben bekomme ich die Fehlermeldung: 500 - Interner Serverfehler. Problem bei der gesuchten Ressource. Sie kann nicht angezeigt werden. Es erscheint aber nicht die logon.aspx, die sich direkt im Download-Ordner befindet (wo sich auch die web.config befindet).
Ich benutze den IIS 7.5 auf Windows Server 2008 64bit.
Was mache ich falsch, bzw. wie bekomme ich das hin?
Vielen Dank
Ringo
ich möchte innerhalb unserer Webseite den Downloadbereich (alle Dateien in allen Unterverzeichnissen) mit einer Forms authentication mit Benutzername und Passwort schützen. Für Aspx-Seiten geht das in der web.config relativ einfach. Aber für statische Dateien bekomme ich es einfach nicht hin.
Ich habe dazu den Download-Ordner im IIS in eine Anwendung konvertiert und in der web.config versucht die statische Dateien einzubinden.
<?xml version=1.0 encoding=UTF-8?>
<configuration>
<system.webserver>
<handlers>
<!-- classic mode .htm handler to make asp.net handle .htm requests -->
&l<add name=HtmlHandler-Classic path=*.* verb=GET,HEAD,POST,DEBUG modules=IsapiModule scriptProcessor=C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll requireAccess=Script preCondition=classicMode,runtimeVersionv4.0,bitness64></add>
<!-- integrated pipeline mode handler to make asp.net handle .htm requests -->
<add name=HtmlHandler-Integrated path=*.* verb=GET,HEAD,POST,DEBUG modules=ManagedPipelineHandler requireAccess=Script preCondition=integratedMode type=System.Web.UI.PageHandlerFactory> </add>
</handlers>
</system.webserver>
<system.webServer>
<modules>
<remove name=FormsAuthenticationModule />
<add name=FormsAuthenticationModule type=System.Web.Security.FormsAuthenticationModule />
<remove name=UrlAuthorization />
<add name=UrlAuthorization type=System.Web.Security.UrlAuthorizationModule />
<remove name=DefaultAuthentication />
<add name=DefaultAuthentication type=System.Web.Security.DefaultAuthenticationModule />
</modules>
</system.webServer>
<system.web>
<authentication mode=Forms>
<forms loginUrl=logon.aspx name=.ASPXFORMSAUTH>
<credentials passwordFormat=Clear>
<user name=test1 password=test1 />
<user name=test2 password=test2 />
<user name=test3 password=test3 />
</credentials>
</forms>
</authentication>
<authorization>
<deny users=? />
</authorization>
<customErrors mode=Off />
</system.web>
<appSettings file=*.* />
</configuration>
Mit diesen Angaben bekomme ich die Fehlermeldung: 500 - Interner Serverfehler. Problem bei der gesuchten Ressource. Sie kann nicht angezeigt werden. Es erscheint aber nicht die logon.aspx, die sich direkt im Download-Ordner befindet (wo sich auch die web.config befindet).
Ich benutze den IIS 7.5 auf Windows Server 2008 64bit.
Was mache ich falsch, bzw. wie bekomme ich das hin?
Vielen Dank
Ringo