Avatar billede hansi67 Nybegynder
07. februar 2004 - 21:03 Der er 1 løsning

web.config, Forms-Based Authentication - newbie spørgsmål

Hey.. jeg har et lille problem med en web.config fil.

Jeg har "lånt" koden fra http://www.dotnetjunkies.com/quickstart/util/srcview.aspx?path=/quickstart/aspplus/samples/security/CookieAuth/cookieauth.src&file=CS\web.config&font=3  til at lave formbaseret sikkerhed med:
----
<configuration>
  <system.web>
      <authentication mode="Forms">
        <forms name=".ASPXUSERDEMO" loginUrl="login.aspx" protection="All" timeout="60" />
      </authentication>
      <authorization>
        <deny users="?" />
      </authorization>
    <globalization requestEncoding="UTF-8" responseEncoding="UTF-8" />
  </system.web>
</configuration>
----

Det virker fint, lige indtil jeg selv retter lidt i kode for at lave sikkerheden på et under-bibliotek (testbib), istedet for rod-biblioteket ved at gøre følgende:

---- med min tilhøjelse af <location> --
<configuration>
<location path="testbib">
  <system.web>
      <authentication mode="Forms">
        <forms name=".ASPXUSERDEMO" loginUrl="login.aspx" protection="All" timeout="60" />
      </authentication>
      <authorization>
        <deny users="?" />
      </authorization>
    <globalization requestEncoding="UTF-8" responseEncoding="UTF-8" />
  </system.web>
</location>
</configuration>
----

Når jeg så retter min browser i mod en fil i underbiblioteket "testbib" får jeg følgende fejl :

-----
Server Error in '/test' Application.

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

Source Error:


Line 2:  <location path="testbib">
Line 3:    <system.web>
Line 4:        <authentication mode="Forms">
Line 5:          <forms name=".ASPXUSERDEMO" loginUrl="testbib/login.aspx" protection="All" timeout="60" />
Line 6:        </authentication>


Source File: C:\Inetpub\wwwroot\Test\web.config    Line: 4
-----

Hvad er det så jeg har misforstået med hensyn til <location path="testbib"> i min web.config fil ?

hilfe plz ;o)
Avatar billede hansi67 Nybegynder
29. februar 2004 - 00:45 #1
Lukker spørgsmål!
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
IT-kurser om Microsoft 365, sikkerhed, personlig vækst, udvikling, digital markedsføring, grafisk design, SAP og forretningsanalyse.

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester