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

Forums / Set-up & Installation / Page Properties -> More Options -> Anonymous access allow not working?

Page Properties -> More Options -> Anonymous access allow not working?

10 posts, 0 answered
  1. Scott Harrington
    Scott Harrington avatar
    28 posts
    Registered:
    21 Sep 2009
    23 Sep 2009
    Link to this post
    Hello,

    I've been working on this issue now for a couple of days and just can't seem to get it correct.  I am trying to setup Anonymous access to my Sitefinity page.  I am allowing anonymous users to be redirected to my 'About Us' page and that is it, all other pages should be available ONLY for authenticated users.Here's a little synopsis of the site I have setup.  I've got 7 pages setup, of those 7 pages I have a single page (About Us) that I've configured for anonymous access allow.  The rest of the 6 pages are all anonymous access denied.  I do not have page groups, and each page has specific roles assigned to it.  The 'About Us' page is configured so that all roles have viewing permissions at the least.  I have a link on the page to allow login if the user choses to do so.  Ok, so with that said here is a snapshot of my web.config file at the root level:

    <authentication mode="Forms">
                <forms name=".ASPNET" loginUrl="~/AboutUs" protection="All" timeout="1440" path="/" />
    </authentication>

    <authorization>
                <allow users="?" />
    </authorization>

    Additional info: when I try to navigate to 'http://MyDomain/MySite/AboutUs.aspx' nothing happens, no timeout, no errors, just sits there trying to connect.  This is of course when I have not logged in previously, no auth cookies are set. What am I missing here?  Thanks for your time, I really hope I can get this thing resolved soon!
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    24 Sep 2009
    Link to this post
    Hi Scott Harrington,

    1. The loginUrl should contains the page extension loginUrl = "~/AboutUs.aspx"

    <authentication mode="Forms"
                <forms name=".ASPNET" loginUrl="~/AboutUs" protection="All" timeout="1440" path="/" /> 
    </authentication> 
     
    <authorization> 
                <allow users="?" /> 
    </authorization> 
     

    2. "I am trying to setup Anonymous access to my Sitefinity page.  I am allowing anonymous users to be redirected to my 'About Us' page and that is it"

    The above configuration means that all non authenticated requests will redirected to your AboutUs.aspx page.

    Generally : Anonymous access  - Allow- this means that all users may see this page - authenticated and not authenticated.
                         Anonymous access - Deny - only authenticated users will see this page. The not authenticated users will be redirected to AboutUs.aspx page ( in your case).

    I hope that this clear the things.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Scott Harrington
    Scott Harrington avatar
    28 posts
    Registered:
    21 Sep 2009
    24 Sep 2009
    Link to this post
    Thanks you for the quick reply.  I cought the missing .aspx after I submitted the ticket/Post, even after adding the extention I am not getting the correct results.  You do have the bullets correct and that is the exact result I am looking for (all non auth users will be redirected the AboutUs.aspx page), unfortunately, this is not the result.  Is there anything I can send you that might help resolve this issue?  Or is there any clear step-by-step/How To's/Demo's that might walk me through setting this scenario up, ie - what EXACTLY the web.config should contain or NOT contain, to any more modifications that should be made to the VS2008 Solution file, and any additional configurations within the Sitefinity UI?  Thanks a lot for your time and efforts in helping me with this situation!
  4. Scott Harrington
    Scott Harrington avatar
    28 posts
    Registered:
    21 Sep 2009
    24 Sep 2009
    Link to this post
    I've made some progress on this issue.  I've now narrowed it down to the custom template I created.  If the template (myTemplate.master) contains a Code file (myTemplate.master.cs) then I cannot get access to my page with a non authenticated user.  I tested this by creating a new Template with only a blank Page_Load in the .cs file.  I uploaded the file into Sitefinity, then tested my issue.  I could not navigate to the page without logging in first.  So I uploaded the same Template minus the .cs into sitefinity, and I was able to navigate to the page...  Am I missing something?  Thanks.
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    28 Sep 2009
    Link to this post
    Hi Scott Harrington,

    If there is not any logic in the code behind of your master page  the anonymous settings should work correctly.

    Anonymous access  - Allow- the users should not be authenticated to see your page.
    Anonymous access - Deny - the users should be authenticated to see your page.


    If the problem persists, please send us a screen cast that shows the master page and its code behind, forms authentication web.config settings, user's permissions over this page and the security settings that you have applied over this page.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. K
    K avatar
    3 posts
    Registered:
    24 Oct 2008
    24 Nov 2009
    Link to this post
    Hi everyone,

    I don't know if this is the place I should post my question.
    How can I allow access to certain pages of my website for Internet users ?

    Basically, to access a page, let's say "About Us", an Internet user will need to log in first (redirection to a login page).
    Besides, I would like to have this page displayed on the navigation menu only when this user successfully logs in, otherwise not.

    Thanks in advance.


    Cheers,
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    24 Nov 2009
    Link to this post
    Hello K,

    Anonymous access - Deny works exactly in the same way you want. When for a page is set  Anonymous access - Deny - this page is not visible in the navigation until the use is authenticated and user's role has at least "View" permissions. When  Anonymous access - Deny and an not authenticated user tries to access the page he/she will be redirected to the FormsAutnetication loginUrl declared in your web.config.

    Let us know if there is anything else that we can do for you.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  8. K
    K avatar
    3 posts
    Registered:
    24 Oct 2008
    24 Nov 2009
    Link to this post
    Hi Ivan,

    yeah, it's not showing up only when you log in as a user...

    What I would like is
    setting the page up to "Deny" in order to not being shown on the Live website...


    Is it possible ?

    Cheers,

    K.
  9. K
    K avatar
    3 posts
    Registered:
    24 Oct 2008
    24 Nov 2009
    Link to this post
    What you mean is

    If I am creating a login form and replace it in the web.config, does that mean that any pages that a user will try to access will redirect him/her to this login form ?

    Or maybe I did not get it at all :-) ???

    Many thanks !

    K.
  10. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    25 Nov 2009
    Link to this post
    Hi K,

    By default, the pages set to Anonymous should not show in the sitemap for unauthenticated users. I hope this is what you see in your scenario. As for the login form, you can create your own, then open own - defined in the forms authentication module:
    <authentication mode="Forms">
         <forms name=".ASPNET" loginUrl="~/sitefinity/login.aspx" protection="All" timeout="1440" path="/" defaultUrl="/sitefinity/Pages.aspx" />
       </authentication>
    - and in the page_load event of that form check if you should show your own form, or the default Sitefinity form. 

    Let me know if you have any further questions. 

    Greetings,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
10 posts, 0 answered