Forums

Skip Navigation LinksHome / Developer Network / Forums / Sitefinity Older Versions (3.x): Bugs & Issues > Creating New User Authentication and authorization

Creating New User Authentication and authorization

  • shraddha avatar

    Posted on Jul 2, 2009 (permalink)

    Hi,
    I am creating website in sitefinity. I want to add user registration and login functionality in the website.
    There is already default authentication used for Sitefinity and other user authenticated page.
    I want to use existing authentication for sitefinity section and want to create new authentication for those registered users for my after login pages.
    How can I do the same.
    Please help................

    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Jul 2, 2009 (permalink)

    Hi shraddha,

    If both the authentication pages will be accessed with the same username and password for a user you should use one membership provider that has been set in your web.config file. For these page you can use Login control and set Destination page url.  All pages that you do not want to be accessible from not authenticated users can be set as "Deny Annonymous" from page porperties or you can use Page.Request.IsAuthenticated in a user control.

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

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.

    Reply

  • shraddha avatar

    Posted on Jul 2, 2009 (permalink)

    Hi Ivan,
    thanx for the reply.....
    But i have to keep those users separate, as registration fields and validations are predefined for those users. And there will be some more user specific data that i want to store. So it will be better that we use different authentication and authorization.

    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Jul 2, 2009 (permalink)

    Hi shraddha,

    So it will be better that we use different authentication and authorization.

    Then for the second authentication use different membership provider and persists user's specific data.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.

    Reply

  • shraddha avatar

    Posted on Jul 2, 2009 (permalink)

    HI Ivan,
    I want to keep login page for both the types of users separate. Even if I use different membership provider for those users, how can i give different authentication and login url for both the types?
    I want to use ~/sitefinity/login.aspx for all the pages in /sitefinity section.
    And the other pages for which I select "Anonymous access= deny", for those pages to access, user should get redirected to some other login page.

    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Jul 2, 2009 (permalink)

    Hi shraddha,

    In Sitefinity/login.aspx.cs, on Page_Load event add the following logic

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

    If the request come from a website page you will be redirected to a publicLoginPage where a user have to be authenticated. If your request contains "/sitefinity" you will be redirected to the backend login page.

    I hope this helps.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.

    Reply

  • Register for webinar
Skip Navigation LinksHome / Developer Network / Forums / Sitefinity Older Versions (3.x): Bugs & Issues > Creating New User Authentication and authorization