Forums

Skip Navigation LinksHome / Developer Network / Forums / Sitefinity Older Versions (3.x): Security > Retrieving connectionString from an external source

Retrieving connectionString from an external source

  • Zia avatar

    Posted on Nov 2, 2010 (permalink)

    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

    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Nov 3, 2010 (permalink)

    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

    Reply

  • Zubair Intermediate avatar

    Posted on Mar 2, 2011 (permalink)

    Hi Ivan,

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

    Thanks,

    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Mar 2, 2011 (permalink)

    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!

    Reply

  • Register for webinar
Skip Navigation LinksHome / Developer Network / Forums / Sitefinity Older Versions (3.x): Security > Retrieving connectionString from an external source