What is the difference between Integrated Security = True and Integrated Security = SSPI?

后端 未结 9 2225
独厮守ぢ
独厮守ぢ 2020-11-22 10:36

I have two apps that use Integrated Security. One assigns Integrated Security = true in the connection string, and the other sets Integrated Security = S

9条回答
  •  闹比i
    闹比i (楼主)
    2020-11-22 11:04

    Many questions get answers if we use .Net Reflector to see the actual code of SqlConnection :) true and sspi are the same:

    internal class DbConnectionOptions
    
    ...
    
    internal bool ConvertValueToIntegratedSecurityInternal(string stringValue)
    {
        if ((CompareInsensitiveInvariant(stringValue, "sspi") || CompareInsensitiveInvariant(stringValue, "true")) || CompareInsensitiveInvariant(stringValue, "yes"))
        {
            return true;
        }
    }
    
    ...
    

    EDIT 20.02.2018 Now in .Net Core we can see its open source on github! Search for ConvertValueToIntegratedSecurityInternal method:

    https://github.com/dotnet/corefx/blob/fdbb160aeb0fad168b3603dbdd971d568151a0c8/src/System.Data.SqlClient/src/System/Data/Common/DbConnectionOptions.cs

提交回复
热议问题