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

Forums / Security / Retrieving connectionString from an external source

Retrieving connectionString from an external source

4 posts, 0 answered
  1. Zia
    Zia avatar
    4 posts
    Registered:
    14 Oct 2010
    02 Nov 2010
    Link to this post
    One of the security requirements of my project is to remove connectionString data from the web.config file.  This data must be encrypted and stored outside of the application and decrypted only when application needs to connect to database.

    Is it possible to remove connectionStrings section in the web.config and register a connectionString provider external to the Sitefinity?  This provider will handle retrieving connectionString data and decrypting it.

    Thanks,
    Zia
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    19 Sep 2016
    03 Nov 2010
    Link to this post
    Hi Zia,

    You can do this by creating a custom HttpModule which should be executed before our CmsHttpModule - you have to register your custom HttpModule before CmsHttpModule in the web.config and write in the <connectionStrings> node by using System.Configuration.ConfigurationManager class.

    Regards,
    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
  3. Zubair
    Zubair avatar
    142 posts
    Registered:
    26 Dec 2007
    02 Mar 2011
    Link to this post
    Hi Ivan,

    I have the same requirement, can you give us a sample code that does what you said?

    Thanks,
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    19 Sep 2016
    02 Mar 2011
    Link to this post
    Hi Zubair,

    You can take a look at the posts articles below

    • http://msdn.microsoft.com/en-us/library/aa719858%28v=vs.71%29.aspx
    • http://stackoverflow.com/questions/360024/how-do-i-set-a-connection-string-config-programatically-in-net
    • http://stackoverflow.com/questions/63546/vs2005-c-programmatically-change-connection-string-contained-in-app-config



    All the best,
    Ivan Dimitrov
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Register for webinar
4 posts, 0 answered