Skip to content

Commit 454da94

Browse files
committed
rename to resource
1 parent 7c9b0f3 commit 454da94

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SSPI/NativeSSPIContextProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ protected override bool GenerateSspiClientContext(ReadOnlySpan<byte> incomingBlo
6262
var sendLength = s_maxSSPILength;
6363
var outBuff = outgoingBlobWriter.GetSpan((int)sendLength);
6464

65-
if (0 != SniNativeWrapper.SniSecGenClientContext(handle, incomingBlob, outBuff, ref sendLength, authParams.ServerName))
65+
if (0 != SniNativeWrapper.SniSecGenClientContext(handle, incomingBlob, outBuff, ref sendLength, authParams.Resource))
6666
{
6767
return false;
6868
}

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SSPI/NegotiateSSPIContextProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ protected override bool GenerateSspiClientContext(ReadOnlySpan<byte> incomingBlo
1616
{
1717
NegotiateAuthenticationStatusCode statusCode = NegotiateAuthenticationStatusCode.UnknownCredentials;
1818

19-
_negotiateAuth ??= new(new NegotiateAuthenticationClientOptions { Package = "Negotiate", TargetName = authParams.ServerName });
19+
_negotiateAuth ??= new(new NegotiateAuthenticationClientOptions { Package = "Negotiate", TargetName = authParams.Resource });
2020
var sendBuff = _negotiateAuth.GetOutgoingBlob(incomingBlob, out statusCode)!;
2121

2222
// Log session id, status code and the actual SPN used in the negotiation

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SSPI/SSPIContextProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ internal void SSPIData(ReadOnlySpan<byte> receivedBuff, IBufferWriter<byte> outg
5757
private bool RunGenerateSspiClientContext(ReadOnlySpan<byte> incomingBlob, IBufferWriter<byte> outgoingBlobWriter, string serverSpn)
5858
{
5959
var options = _parser.Connection.ConnectionOptions;
60-
var authParams = new SspiAuthenticationParameters(serverSpn)
60+
var authParams = new SspiAuthenticationParameters(options.DataSource, serverSpn)
6161
{
6262
DatabaseName = options.InitialCatalog,
6363
UserId = options.UserID,

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SSPI/SspiAuthenticationParameters.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ namespace Microsoft.Data.SqlClient
44
{
55
internal sealed class SspiAuthenticationParameters
66
{
7-
public SspiAuthenticationParameters(string serverName)
7+
public SspiAuthenticationParameters(string serverName, string resource)
88
{
99
ServerName = serverName;
1010
}
1111

12+
public string Resource { get; }
13+
1214
public string ServerName { get; }
1315

1416
public string? UserId { get; set; }

0 commit comments

Comments
 (0)