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

Forums / Security / Change Login Page

Change Login Page

8 posts, 0 answered
  1. kevin croke
    kevin croke avatar
    6 posts
    Registered:
    11 Sep 2009
    16 Sep 2009
    Link to this post
    I updated my web.config to say:
        <authentication mode="Forms"
                <forms name=".ASPNET" loginUrl="/Shop/login.aspx" protection="All" timeout="1440" path="/"/> 
            </authentication> 

    Why then when I go to /Sitefinity/default.aspx does the default sitefinity login page get displayed?

    Thanks,
    Kevin
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    16 Sep 2009
    Link to this post
    Hi kevin croke,

    1. Add Tilda in the value of loginUrl. Otherwise you will get 404 error.

    2. loginUrl is the URL for the login page that the FormsAuthentication class will redirect to. The default is "login.aspx." If you want to access a page ( or other resurce) which is denied for anonymous users you will be redirected to this loginUrl to authenticate yourself.

    All the best,
    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. Steve
    Steve avatar
    11 posts
    Registered:
    18 Dec 2008
    17 Sep 2009
    Link to this post
    Ivan,  We have also noticed a change to our login page as we updated to 3.7.  The control was redirecting the logged user to our home page.  I would use the select destination page lookup, and it would return the page, tilde and all, but not save the page upon saving changes.  I have seen this before and my trick is to manually insert a trailing space to the inserted destination page name, which seems to work around this defect in the landing page.  Hope this advice applies here.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    17 Sep 2009
    Link to this post
    Hello Steve,

    There is a problem with Login control and its second level properties. If you want to use the WebEditor to set project's pages as DestinationUrl you can expose the property on the first level.

    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.
  5. Steve
    Steve avatar
    11 posts
    Registered:
    18 Dec 2008
    17 Sep 2009
    Link to this post
    Any point to documentatin or forum entries about how to expose this at the first level?
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    17 Sep 2009
    Link to this post
    Hello Steve,

    Sample code is shown below:

    [WebEditor("Telerik.Cms.Web.UI.UrlEditorWrapper, Telerik.Cms")] 
        public string DestinationPageUrlFix 
        { 
            get 
            { 
                return this.Login1.DestinationPageUrl; 
            } 
            set 
            { 
                this.Login1.DestinationPageUrl = value; 
            } 
     
        } 

    The control can be found under ~/Sitefinity/UserControls/Login folder.


    All the best,
    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.
  7. Kelly Ward
    Kelly Ward avatar
    7 posts
    Registered:
    04 Dec 2009
    16 Dec 2009
    Link to this post
    Hi, I think I have a similar question related to this post. I needed to create a page that would only be accessible to a particular site visitor, I set up the user and the roll and set the page with the proper permissions.  What I need to be able to do is show the user a different styled login page, currently they see the sitefinity one, while this is fine for the site admins and content editors, this page I am restricting is for a site visitor not a site admin so I don't want them to see the site finity login, they might think they left the site or something

    I am sure there is a way to do this, please let me know,
    Kelly
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    16 Dec 2009
    Link to this post
    Hello Kelly Ward,

    In ~/Sitefinity/Login.aspx.cs Page_Load add the following lines which checks from where a request comes form

    // check where does it come from
     string redirectUrl = Request.QueryString["ReturnUrl"];
     if (!string.IsNullOrEmpty(redirectUrl) && !redirectUrl.StartsWith("/sitefinity"))
     {
         Response.Redirect("~/publicLoginPage.aspx?ReturnUrl=" + redirectUrl);
     }

    Then you should have a landing page with login control that non admin users should see. Another option is just adding a simple user control that redirects all not authenticated users to a custom login page

    if (!this.Page.Request.IsAuthenticated)
           Response.Redirect("yourloginpage.aspx");

    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.
Register for webinar
8 posts, 0 answered