More in this section

Forums / Developing with Sitefinity / SSL dinamically per session

SSL dinamically per session

2 posts, 0 answered
  1. Anca
    Anca avatar
    4 posts
    21 Apr 2010
    21 Apr 2010
    Link to this post

    There's a sitefinity site on which user is can log in. After he/she is logged in, different user information need to be displayed on every page (there's a top information bar). This site is supposed to work on HTTP protocol for anonymus users, but once an user has logged in all info should be displayed on a HTTPS protocol - so once user is logged in site should work on SSL.
    Due this, RequireSSL property cannot be used (I mean not overwrited in DB) since same website pages should be available on HTTP for anonymus, but on HTTPS for logged in users.
    Is there a way to set SSL or Non-SSL dinamically, in order to support above scenario?

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    21 Apr 2010
    Link to this post
    Hello Anca Butincu,

    You have to create a custom HttpModule that inherits from CmsHttpModule. Then override IsAuthenticated. If the function returns true make redirection to https

    private void RedirectToHttps()
               HttpContext context = HttpContext.Current;          context.Response.Redirect(context.Request.Url.AbsoluteUri.Replace("http://", "https://"), true);

    All the best,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
2 posts, 0 answered