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

Forums / Bugs & Issues / Creating New User Authentication and authorization

Creating New User Authentication and authorization

6 posts, 0 answered
  1. shraddha
    shraddha avatar
    87 posts
    Registered:
    18 May 2009
    02 Jul 2009
    Link to this post
    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................
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    02 Jul 2009
    Link to this post
    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.
  3. shraddha
    shraddha avatar
    87 posts
    Registered:
    18 May 2009
    02 Jul 2009
    Link to this post
    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.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    02 Jul 2009
    Link to this post
    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.
  5. shraddha
    shraddha avatar
    87 posts
    Registered:
    18 May 2009
    02 Jul 2009
    Link to this post
    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.
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    02 Jul 2009
    Link to this post
    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.
Register for webinar
6 posts, 0 answered