Jan 28, 2019 05:21 PM|PatriceSc|LINK
If you really can't upgrade from 4.0 (which is AFAIK not supported any more) you could try perhaps WIF 3.5 (https://docs.microsoft.com/en-us/dotnet/framework/security/whats-new-in-wif
is for 4.5 but describes changes from 3.5, maybe you'll find the 3.5 documentation archived). Depending on your OS, WIF 3.5 could be a Windows feature :
If you can upgrade to 4.5.2 (which is AFAIK the oldest supported version) just create a Template using
http://www.cloudidentity.com/blog/2014/02/12/use-the-on-premises-organizational-authentication-option-adfs-with-asp-net-in-visual-studio-2013/ and move your app to this by adding the missing nuget packages and code.