Newbie site with a lightswitch app and Forms Authentication

Discussion in 'Site Programming, Development and Design' started by 0015886, Oct 26, 2011.

  1. Sorry for my poor english and long explanation.

    As I'm a newbie I built a new asp.net website, following the VS2010 template with login form, and in the site project added :
    an empty subfolder '\MyApp'
    a subfolder '\MemberPages' with a Members.aspx containing an hyperlink to '\MyApp' folder.

    Configured users and roles with VS ASp.net administration tool, with rules to deny anonymous users access to '\MemberPages' and '\MyApp'.
    Changed connection strings and ftp'd succesfully to Winhost.
    With remote IIS manager I disabled Basic Auth, enabled Forms Auth pointing to the correct login page and set authorization rules.

    Everything ok so far, my login page pops up every time I try to open protected pages and folders and let me access only with user/pwd.

    Before setting up the website I already succesfully published and run a Lighswitch Desktop 3-tier test app in a folder, let's say '\LSAPP' with the app starting point declared in control panel.

    After site was published I removed the 'LSAPP' app starting point, copied all the LSAPP folder content in site's '\MyApp' and setup the new app starting point '\MyApp'.
    Tried to revise accordingly MyApp's web.config and IIS manager settings (I think here is the problem).

    Now, when i click my site's link to 'MyApp' folder the login form comes up, I type the user/pwd, login is successful as I can see my user logged with 'log out' option available, but I'm always redirected again to the login form.

    'MyApp' web.config contanis :

    <authentication mode="Forms">
    <forms loginUrl="/Account/Login.aspx" timeout="2880" />
    </authentication>

    <authorization>
    <deny users="?" />
    </authorization>

    If I comment the <authorization> section everything works, but obviously without login.

    Someone can help me ?
    Thanks in advance.
     
    Last edited by a moderator: Oct 14, 2015
  2. does anyone can help ?

    I removed all the content from '\MyApp' subfolder and published again my lightswitch app directly from VS exactly in the same folder.

    But, again, navigating to 'MySite/MyApp' the login form keeps asking my credentials again and again...
    Everything works if I remove the Deny authorization rule to anonymous users, so this makes me think that the lightswitch module is invoked correctly.

    (After publishing, as all previous web.config files went lost, I used IIS7 manager to enable again Forms Authentication on the folder and to add the Deny authorization rule to anonymous users)

    Does the problem can sit in '\MyApp' subfolders authorizations ? 'bin' and 'web' folder, where all dll's and MyApp.Client.Xap reside, need to have their web.config files with some settings ? from IIS manager I see the authentication and authorizations are inherited with 'Forms Authentication' and 'Deny anonymous users'...
     

Share This Page