How to force user to login first to access the application when using the link that is saved on the bookmarks. RRS feed

  • Question

  • User2143564534 posted

    Please kindly help here is an example of the link that the user has saved on the bookmarks o google chrome the user clicks the link and it just directs to the exact page,  http://localhost:4235/Admin/AddEvent.aspx 

    How can i force the user to go to login if the click the above link.

    Please help

    Wednesday, January 10, 2018 9:14 AM

All replies

  • User753101303 posted


    What happens currently? Do you have some authorization in place? If not see https://msdn.microsoft.com/en-us/library/8d82143t(v=vs.85).aspx

    ASP.NET should do this out of the box ie if a page is not allowed, ASP.NET direct the user to the login page and keep the return url so that once logged the user can be directed back to the page he tried to access.

    For now I asume this link is not configured to be restricted only to some users ?

    Wednesday, January 10, 2018 10:36 AM
  • User61956409 posted

    Hi Eosia,

    According to you description, it seems that you want to redirect unauthenticated users to login page. If you do not do anything to authenticate and authorize users in your application, an easy way to achieve it, you can try to implement simple forms authentication, which can help you understand how authentication and authorization secure application.

    With Regards,

    Fei Han

    Thursday, January 11, 2018 5:35 AM
  • User2143564534 posted

    Thank you so much i will try the solution on the link you gave me.

    Thursday, January 11, 2018 7:41 AM