177 references to NegotiateAuthenticationStatusCode
Microsoft.AspNetCore.Authentication.Negotiate (14)
Internal\NegotiateState.cs (14)
22var outgoingBlob = _instance.GetOutgoingBlob(incomingBlob, out var authStatus); 24if (authStatus == NegotiateAuthenticationStatusCode.Completed || 25authStatus == NegotiateAuthenticationStatusCode.ContinueNeeded) 71private static bool IsCredentialError(NegotiateAuthenticationStatusCode error) 73return error == NegotiateAuthenticationStatusCode.UnknownCredentials || 74error == NegotiateAuthenticationStatusCode.CredentialsExpired || 75error == NegotiateAuthenticationStatusCode.BadBinding; 78private static bool IsClientError(NegotiateAuthenticationStatusCode error) 80return error == NegotiateAuthenticationStatusCode.InvalidToken || 81error == NegotiateAuthenticationStatusCode.QopNotSupported || 82error == NegotiateAuthenticationStatusCode.UnknownCredentials || 83error == NegotiateAuthenticationStatusCode.MessageAltered || 84error == NegotiateAuthenticationStatusCode.OutOfSequence || 85error == NegotiateAuthenticationStatusCode.InvalidCredentials;
System.Net.Http (3)
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.NtAuth.cs (3)
183NegotiateAuthenticationStatusCode statusCode; 187if (statusCode > NegotiateAuthenticationStatusCode.ContinueNeeded || challengeResponse == null) 210if (statusCode > NegotiateAuthenticationStatusCode.ContinueNeeded)
System.Net.Mail (9)
System\Net\Mail\SmtpNegotiateAuthenticationModule.cs (6)
54NegotiateAuthenticationStatusCode statusCode; 61if (statusCode != NegotiateAuthenticationStatusCode.Completed && 62statusCode != NegotiateAuthenticationStatusCode.ContinueNeeded) 119NegotiateAuthenticationStatusCode statusCode; 122if (statusCode != NegotiateAuthenticationStatusCode.Completed) 168if (statusCode != NegotiateAuthenticationStatusCode.Completed)
System\Net\Mail\SmtpNtlmAuthenticationModule.cs (3)
40NegotiateAuthenticationStatusCode statusCode; 43if (statusCode != NegotiateAuthenticationStatusCode.Completed && 44statusCode != NegotiateAuthenticationStatusCode.ContinueNeeded)
System.Net.Security (151)
System\Net\NegotiateAuthenticationPal.cs (4)
22public abstract byte[]? GetOutgoingBlob(ReadOnlySpan<byte> incomingBlob, out NegotiateAuthenticationStatusCode statusCode); 23public abstract NegotiateAuthenticationStatusCode Wrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, bool requestEncryption, out bool isEncrypted); 24public abstract NegotiateAuthenticationStatusCode Unwrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, out bool wasEncrypted); 25public abstract NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted);
System\Net\NegotiateAuthenticationPal.ManagedNtlm.cs (19)
241return new UnsupportedNegotiateAuthenticationPal(clientOptions, NegotiateAuthenticationStatusCode.UnknownCredentials); 264public override unsafe byte[]? GetOutgoingBlob(ReadOnlySpan<byte> incomingBlob, out NegotiateAuthenticationStatusCode statusCode) 283statusCode = NegotiateAuthenticationStatusCode.ContinueNeeded; 563private unsafe byte[]? ProcessChallenge(ReadOnlySpan<byte> blob, out NegotiateAuthenticationStatusCode statusCode) 573statusCode = NegotiateAuthenticationStatusCode.InvalidToken; 586statusCode = NegotiateAuthenticationStatusCode.InvalidToken; 593statusCode = NegotiateAuthenticationStatusCode.QopNotSupported; 605statusCode = NegotiateAuthenticationStatusCode.InvalidToken; 699statusCode = NegotiateAuthenticationStatusCode.Completed; 762public override NegotiateAuthenticationStatusCode Wrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, bool _/*requestEncryption*/, out bool isEncrypted) 777return NegotiateAuthenticationStatusCode.Completed; 780public override NegotiateAuthenticationStatusCode Unwrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, out bool wasEncrypted) 791return NegotiateAuthenticationStatusCode.InvalidToken; 799return NegotiateAuthenticationStatusCode.MessageAltered; 804return NegotiateAuthenticationStatusCode.Completed; 807public override NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted) 820return NegotiateAuthenticationStatusCode.InvalidToken; 827return NegotiateAuthenticationStatusCode.MessageAltered; 830return NegotiateAuthenticationStatusCode.Completed;
System\Net\NegotiateAuthenticationPal.ManagedSpnego.cs (25)
97public override unsafe byte[]? GetOutgoingBlob(ReadOnlySpan<byte> incomingBlob, out NegotiateAuthenticationStatusCode statusCode) 140private byte[]? CreateSpNegoNegotiateMessage(ReadOnlySpan<byte> incomingBlob, out NegotiateAuthenticationStatusCode statusCode) 179if (statusCode != NegotiateAuthenticationStatusCode.ContinueNeeded && 180statusCode != NegotiateAuthenticationStatusCode.Completed) 185if (statusCode != NegotiateAuthenticationStatusCode.Unsupported) 212statusCode = NegotiateAuthenticationStatusCode.ContinueNeeded; 216private byte[]? ProcessSpNegoChallenge(ReadOnlySpan<byte> challenge, out NegotiateAuthenticationStatusCode statusCode) 278statusCode = NegotiateAuthenticationStatusCode.InvalidToken; 294statusCode = NegotiateAuthenticationStatusCode.Unsupported; 316statusCode = NegotiateAuthenticationStatusCode.InvalidToken; 326if (statusCode != NegotiateAuthenticationStatusCode.ContinueNeeded && 327statusCode != NegotiateAuthenticationStatusCode.Completed) 345if (statusCode == NegotiateAuthenticationStatusCode.Completed) 357statusCode = state == NegState.RequestMic ? NegotiateAuthenticationStatusCode.ContinueNeeded : NegotiateAuthenticationStatusCode.Completed; 358_isAuthenticated = statusCode == NegotiateAuthenticationStatusCode.Completed; 380statusCode = NegotiateAuthenticationStatusCode.GenericFailure; 386statusCode = NegotiateAuthenticationStatusCode.MessageAltered; 395NegState.AcceptCompleted => NegotiateAuthenticationStatusCode.Completed, 396NegState.AcceptIncomplete => NegotiateAuthenticationStatusCode.ContinueNeeded, 397NegState.Reject => NegotiateAuthenticationStatusCode.UnknownCredentials, 398_ => NegotiateAuthenticationStatusCode.GenericFailure 404public override NegotiateAuthenticationStatusCode Wrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, bool requestEncryption, out bool isEncrypted) 414public override NegotiateAuthenticationStatusCode Unwrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, out bool wasEncrypted) 424public override NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted)
System\Net\NegotiateAuthenticationPal.Unix.cs (38)
53NegotiateAuthenticationStatusCode statusCode = UnixNegotiateAuthenticationPal.GetErrorCode(gex); 54if (statusCode <= NegotiateAuthenticationStatusCode.GenericFailure) 56statusCode = NegotiateAuthenticationStatusCode.Unsupported; 76NegotiateAuthenticationStatusCode statusCode = UnixNegotiateAuthenticationPal.GetErrorCode(gex); 77if (statusCode <= NegotiateAuthenticationStatusCode.GenericFailure) 79statusCode = NegotiateAuthenticationStatusCode.Unsupported; 267public override byte[]? GetOutgoingBlob(ReadOnlySpan<byte> incomingBlob, out NegotiateAuthenticationStatusCode statusCode) 303if (statusCode >= NegotiateAuthenticationStatusCode.GenericFailure) 317if (statusCode == NegotiateAuthenticationStatusCode.Completed) 332public override NegotiateAuthenticationStatusCode Wrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, bool requestEncryption, out bool isEncrypted) 350return NegotiateAuthenticationStatusCode.GenericFailure; 355return NegotiateAuthenticationStatusCode.Completed; 363public override NegotiateAuthenticationStatusCode Unwrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, out bool wasEncrypted) 376Interop.NetSecurityNative.Status.GSS_S_BAD_SIG => NegotiateAuthenticationStatusCode.MessageAltered, 377_ => NegotiateAuthenticationStatusCode.InvalidToken 383return NegotiateAuthenticationStatusCode.Completed; 391public override unsafe NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted) 406Interop.NetSecurityNative.Status.GSS_S_BAD_SIG => NegotiateAuthenticationStatusCode.MessageAltered, 407_ => NegotiateAuthenticationStatusCode.InvalidToken 414return NegotiateAuthenticationStatusCode.Completed; 548private unsafe NegotiateAuthenticationStatusCode InitializeSecurityContext( 661NegotiateAuthenticationStatusCode.Completed : 662NegotiateAuthenticationStatusCode.ContinueNeeded; 667return NegotiateAuthenticationStatusCode.GenericFailure; 675private NegotiateAuthenticationStatusCode AcceptSecurityContext( 716NegotiateAuthenticationStatusCode errorCode; 727errorCode = NegotiateAuthenticationStatusCode.Completed; 731errorCode = NegotiateAuthenticationStatusCode.ContinueNeeded; 740return NegotiateAuthenticationStatusCode.GenericFailure; 749internal static NegotiateAuthenticationStatusCode GetErrorCode(Interop.NetSecurityNative.GssApiException exception) 754return NegotiateAuthenticationStatusCode.UnknownCredentials; 756return NegotiateAuthenticationStatusCode.BadBinding; 758return NegotiateAuthenticationStatusCode.CredentialsExpired; 760return NegotiateAuthenticationStatusCode.InvalidToken; 762return NegotiateAuthenticationStatusCode.InvalidCredentials; 764return NegotiateAuthenticationStatusCode.MessageAltered; 767return NegotiateAuthenticationStatusCode.Unsupported; 770return NegotiateAuthenticationStatusCode.GenericFailure;
System\Net\NegotiateAuthenticationPal.Unsupported.cs (9)
18private NegotiateAuthenticationStatusCode _statusCode; 29public UnsupportedNegotiateAuthenticationPal(NegotiateAuthenticationClientOptions clientOptions, NegotiateAuthenticationStatusCode statusCode = NegotiateAuthenticationStatusCode.Unsupported) 36public UnsupportedNegotiateAuthenticationPal(NegotiateAuthenticationServerOptions serverOptions, NegotiateAuthenticationStatusCode statusCode = NegotiateAuthenticationStatusCode.Unsupported) 46public override byte[]? GetOutgoingBlob(ReadOnlySpan<byte> incomingBlob, out NegotiateAuthenticationStatusCode statusCode) 52public override NegotiateAuthenticationStatusCode Wrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, bool requestEncryption, out bool isEncrypted) => throw new InvalidOperationException(); 53public override NegotiateAuthenticationStatusCode Unwrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, out bool wasEncrypted) => throw new InvalidOperationException(); 54public override NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted) => throw new InvalidOperationException();
System\Net\Security\NegotiateAuthentication.cs (25)
201/// Successful step of the authentication returns either <see cref="NegotiateAuthenticationStatusCode.Completed" /> 202/// or <see cref="NegotiateAuthenticationStatusCode.ContinueNeeded" /> status codes. 205/// When <see cref="NegotiateAuthenticationStatusCode.ContinueNeeded" /> is returned the 208public byte[]? GetOutgoingBlob(ReadOnlySpan<byte> incomingBlob, out NegotiateAuthenticationStatusCode statusCode) 218if (statusCode == NegotiateAuthenticationStatusCode.Completed) 222statusCode = NegotiateAuthenticationStatusCode.TargetUnknown; 226statusCode = NegotiateAuthenticationStatusCode.ImpersonationValidationFailed; 230statusCode = NegotiateAuthenticationStatusCode.SecurityQosFailed; 247/// Successful step of the authentication returns either <see cref="NegotiateAuthenticationStatusCode.Completed" /> 248/// or <see cref="NegotiateAuthenticationStatusCode.ContinueNeeded" /> status codes. 251/// When <see cref="NegotiateAuthenticationStatusCode.ContinueNeeded" /> is returned the 254public string? GetOutgoingBlob(string? incomingBlob, out NegotiateAuthenticationStatusCode statusCode) 280/// <see cref="NegotiateAuthenticationStatusCode.Completed" /> on success, other 281/// <see cref="NegotiateAuthenticationStatusCode" /> values on failure. 290public NegotiateAuthenticationStatusCode Wrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, bool requestEncryption, out bool isEncrypted) 309/// <see cref="NegotiateAuthenticationStatusCode.Completed" /> on success. 310/// <see cref="NegotiateAuthenticationStatusCode.MessageAltered" /> if the message signature was 312/// <see cref="NegotiateAuthenticationStatusCode.InvalidToken" /> if the wrapped message was 314/// Other <see cref="NegotiateAuthenticationStatusCode" /> values on failure. 317public NegotiateAuthenticationStatusCode Unwrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, out bool wasEncrypted) 337/// <see cref="NegotiateAuthenticationStatusCode.Completed" /> on success. 338/// <see cref="NegotiateAuthenticationStatusCode.MessageAltered" /> if the message signature was 340/// <see cref="NegotiateAuthenticationStatusCode.InvalidToken" /> if the wrapped message was 342/// Other <see cref="NegotiateAuthenticationStatusCode" /> values on failure. 345public NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted)
System\Net\Security\NegotiateStream.cs (31)
394NegotiateAuthenticationStatusCode statusCode; 403statusCode = NegotiateAuthenticationStatusCode.InvalidToken; 409statusCode = NegotiateAuthenticationStatusCode.Completed; 417if (statusCode != NegotiateAuthenticationStatusCode.Completed) 523NegotiateAuthenticationStatusCode statusCode; 531statusCode = NegotiateAuthenticationStatusCode.Completed; 538if (statusCode != NegotiateAuthenticationStatusCode.Completed) 755NegotiateAuthenticationStatusCode statusCode = NegotiateAuthenticationStatusCode.Completed; 761if (statusCode is NegotiateAuthenticationStatusCode.BadBinding or 762NegotiateAuthenticationStatusCode.TargetUnknown or 763NegotiateAuthenticationStatusCode.ImpersonationValidationFailed or 764NegotiateAuthenticationStatusCode.SecurityQosFailed) 768NegotiateAuthenticationStatusCode.BadBinding => 770NegotiateAuthenticationStatusCode.TargetUnknown => 772NegotiateAuthenticationStatusCode.ImpersonationValidationFailed => 784else if (statusCode == NegotiateAuthenticationStatusCode.Completed) 814else if (statusCode != NegotiateAuthenticationStatusCode.ContinueNeeded) 818NegotiateAuthenticationStatusCode.BadBinding => (int)Interop.SECURITY_STATUS.BadBinding, 819NegotiateAuthenticationStatusCode.Unsupported => (int)Interop.SECURITY_STATUS.Unsupported, 820NegotiateAuthenticationStatusCode.MessageAltered => (int)Interop.SECURITY_STATUS.MessageAltered, 821NegotiateAuthenticationStatusCode.ContextExpired => (int)Interop.SECURITY_STATUS.ContextExpired, 822NegotiateAuthenticationStatusCode.CredentialsExpired => (int)Interop.SECURITY_STATUS.CertExpired, 823NegotiateAuthenticationStatusCode.InvalidCredentials => (int)Interop.SECURITY_STATUS.LogonDenied, 824NegotiateAuthenticationStatusCode.InvalidToken => (int)Interop.SECURITY_STATUS.InvalidToken, 825NegotiateAuthenticationStatusCode.UnknownCredentials => (int)Interop.SECURITY_STATUS.UnknownCredentials, 826NegotiateAuthenticationStatusCode.QopNotSupported => (int)Interop.SECURITY_STATUS.QopNotSupported, 827NegotiateAuthenticationStatusCode.OutOfSequence => (int)Interop.SECURITY_STATUS.OutOfSequence, 833NegotiateAuthenticationStatusCode.InvalidCredentials => 889_context.GetOutgoingBlob(message, out NegotiateAuthenticationStatusCode statusCode); 890_remoteOk = statusCode is NegotiateAuthenticationStatusCode.Completed;