+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Redirect unauthenticated users to my own login page

Redirect unauthenticated users to my own login page

5 posts, 0 answered
  1. Srk
    Srk avatar
    13 posts
    Registered:
    28 Feb 2012
    22 Jun 2013
    Link to this post
    Hello,
    I have demo folder in my sitefinity app. Demo folder contains pdf files. I want to do something like when someone search pdf and click on it, user must be redirect to my custom login page instead of sitefinity login page. I did the below code in web.config file and it works fine but i am redirecting to sitefinity login page. I want to redirect users to my custom login page. Can any one suggest me the code or something help !! Here is the web.config code:

      <location path="doc">
        <system.web>
          <authorization>
            <allow users="Admin"/>
            <deny users="*"/>
            <!--Deny everyone else Admin role Users-->
          </authorization>
        </system.web>
      </location>
  2. Jen Peleva
    Jen Peleva avatar
    568 posts
    Registered:
    10 Nov 2016
    26 Jun 2013
    Link to this post
    Hi,

    I have already responded in your support ticket.

    Regards,
    Jen Peleva
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Daren
    Daren avatar
    5 posts
    Registered:
    26 Jun 2012
    16 Oct 2013 in reply to Jen Peleva
    Link to this post
    It would be nice to see the solution here as well.
  4. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    16 Oct 2013 in reply to Daren
    Link to this post
    The only way we could get it to work is to use the SF permissions to handle it.   So in the advanced settings setup the frontendlogin url.  That tells SF which page to load when the user doesn't have permissions.

    The PROBLEM is that the pages\resources need to be physical sitefinity assets.  So like an external ASPX page secured with the webconfig would be totally hosed because it then goes to /Sitefinity/Login
  5. Ivan D. Dimitrov
    Ivan D. Dimitrov avatar
    310 posts
    Registered:
    26 Mar 2015
    21 Oct 2013
    Link to this post
    Hi all,

     The way I managed to achieve this result is by using the custom handler to plugin your logic in the IMediaContentDownloadEvent which is executed each time a media content is being downloaded or viewed. Note to check if the content is a document there. 

    Additionally you should be able to globally set the permissions from the parent object (the library) - see video. So I would suggest to have one library which is only for documents of this type and set the permissions directly from the library - the documents should inherit their permissions form it. I would also suggest to either remove the Allow: Authenticated or Deny: Anonymous.

    Regards,
    Ivan D. Dimitrov
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
5 posts, 0 answered