0
votes

I'm building an app where I'm using Forms authentication to authenticate the logged in users.

Login.aspx page contains other links to redirect users to another page but it won't redirect users to those pages unless logged in.

http://localhost:1607/Account/Login.aspx?

When I click on a link to redirect users to about.aspx it goes back to login page with the following URL

http://localhost:1607/Account/Login.aspx?ReturnUrl=%2fAbout.aspx

how do I remove returnURL and redirect users to /about.aspx page? web.config file has forms authentication.

<authentication mode="Forms">
        <forms loginUrl="~/Account/Login.aspx" timeout="2880" slidingExpiration="true" protection="All" defaultUrl="~/Default.aspx"/>
    </authentication>
    <authorization>
        <deny users="?"/>
    </authorization>
1

1 Answers

0
votes

Use the <location> to allow all users, like this:

<location path="about.aspx">
    <system.web>
        <authorization>
            <allow users="*"/>
        </authorization>
    </system.web>
</location>

You need a separate <location> for each page/link you have.