Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi guys.

my web application has authentication and authorization.

I want to open forgot password page form login page. But it is not allowing me to access the page.

I gave access to the page using below code.

XML
<location path="~/ForgotPassword.aspx">
    <system.web>
      <authorization>
        <allow users="*"/>
    
      </authorization>
    </system.web>
  </location>




how to get access to the page from login page.
Posted
Updated 17-Nov-22 1:06am
v4

Piut your login, register, and forgot password pages into a "login" folder, and set it's web.config to "allow all users":
HTML
<system.web>
    <authorization>
        <allow users="*" />
    </authorization>
</system.web>


Do remember that you should never store passwords in clear or encrypted - only as a salted hash, so your "forgot password" page should issue a temporary password to the registered email address, which lasts a short time only.
 
Share this answer
 
Comments
sunnykvinod 22-Sep-15 5:34am    
it is not working
OriginalGriff 22-Sep-15 6:17am    
"it is not working" is the single most useless problem report we get: and it's also the one we get most often.

Imaging your car breaks down in the middle of nowhere. You call a garage, say "it is not working" and put the phone down. How long do you think it is going to take for them to work out who you are, where you are, what car it is, what's wrong with it, what you want them to do, what they need to bring? Me, I think you are still going to be there next week...

So tell us what it does that you don;t expect, or doesn't do that you did. Tell us exactly what you tried, how you tried it, and anything else that might be relevant to the problem!
you should add this
C#
<allow users="?" />


If you are using MVC check the controller of the specific page to allow anonymous meaning it should not be decorated with [Authorize] annotation.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900