In meiner Webanwendung nutzte ich die Formular basierte Authentifizierung. Klappt genau, wie es soll. Ohne Login wird immer wieder nur die Login Seite angezeigt.
Ich habe aber noch weitere Seiten in der Webanwendung, welche aber auch ohne Login nutzbar sein sollen. Aber weil ja immer die Loginseite angezeigt wird, sehe ich zur Zeit keine Möglichkeit, die anderen Seiten anzuzeigen:
<authentication mode="Forms">
<forms name=".IMA" loginUrl="login.aspx" protection="All" timeout="30" path="/"/>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
Im Click Ereignis meiner Login Seite prüfe ich über
private bool CheckPassword(
Int64 incidentId, String password) ;
das Passwort, und kriege entsprechende Rückmeldung, ob das Login gültig ist, und leite dann auf die gewünschte Seite weiter mit
FormsAuthentication.RedirectFromLoginPage(incidentId.ToString(), false);
Ich glaube, ich gehe das Ganze irgendwie falsch an, aber ich komm grad nicht weiter.
Kann man einige Seiten (oder noch besser Unterverzeichniss) in der web.config so konfigurieren dass sie von der Authentifizierung ausgenommen werden ?
Hi!
Das kann man doch alles über die web.config anpassen.
Die Google-Suche nach "Forms authentication"
brachte als erstes Ergebnis:
Damit solltest Du eigentlich Dein Problem lösen können.
lg
Ah, vielen Dank... <localization> war das fehlende Schlagwort..
Jetzt habe ich meine Website gesichert, bis auf ein öffentliches verzeichnis "public".
Alles bestens also... Besten Dank
<system.web>
<customErrors mode="Off"/>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
</assemblies>
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Forms">
<forms name=".IMA" loginUrl="secure/login.aspx" protection="All" timeout="30" path="/"/>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
<location path="public">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>