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

Forums / Bugs & Issues / Redirect unauthenticated users to my own login page

Redirect unauthenticated users to my own login page

3 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 ofsitefinity login page. I did the below code in web.config file and it works fine but i am redirecting tositefinity 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,

    Thank you for using our services!

    You can set permissions to the .pdf that shouldn't be visible for Anonymous users. Please take a look at this blog post,where we show how an Unauthorized event can be used in the Global.asax file.

    http://www.sitefinity.com/blogs/stefani-tacheva-s-blog/2013/02/01/redirect-unauthorized-users-to-a-custom-page
     
    This event is fired, whenever a user that doesn't have permissions, is redirected to some page. I believe it will suit your scenario.

    Let me know if you have any additional questions!

    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. Srk
    Srk avatar
    13 posts
    Registered:
    28 Feb 2012
    27 Jun 2013 in reply to Jen Peleva
    Link to this post
    Jen,

    Thanks for reply. I am facing this issue from a week. I tried the post you given earlier also but every time it is redirecting me to sitefinity login page. Than i put debug point in global.asax file and saw in  global.asax that application_start event is not firing. How should i create custom authorization.!! As i mentioned earlier in my first question i put a piece of code in web.config. Is it the right way ??


    Another thing i tried is to create custom handler ihttphandler and it is working but only statik pdf links not for the pdfs that i uploaded from documents & files.!!

    I am asking for pdfs becuase i search pdfs with  search and search results widget and than if any user clicks on pdf link than he/she must be redirected to my custom login page.

    Please provide the solution asap.

    Thanks & Regards.
3 posts, 0 answered