199 references to NegotiateAuthenticationStatusCode
Microsoft.AspNetCore.Authentication.Negotiate (14)
Internal\NegotiateState.cs (14)
38var outgoingBlob = _instance.GetOutgoingBlob(incomingBlob, out var authStatus); 40if (authStatus == NegotiateAuthenticationStatusCode.Completed || 41authStatus == NegotiateAuthenticationStatusCode.ContinueNeeded) 94private static bool IsCredentialError(NegotiateAuthenticationStatusCode error) 96return error == NegotiateAuthenticationStatusCode.UnknownCredentials || 97error == NegotiateAuthenticationStatusCode.CredentialsExpired || 98error == NegotiateAuthenticationStatusCode.BadBinding; 101private static bool IsClientError(NegotiateAuthenticationStatusCode error) 103return error == NegotiateAuthenticationStatusCode.InvalidToken || 104error == NegotiateAuthenticationStatusCode.QopNotSupported || 105error == NegotiateAuthenticationStatusCode.UnknownCredentials || 106error == NegotiateAuthenticationStatusCode.MessageAltered || 107error == NegotiateAuthenticationStatusCode.OutOfSequence || 108error == NegotiateAuthenticationStatusCode.InvalidCredentials;
System.Net.Http (3)
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.NtAuth.cs (3)
153NegotiateAuthenticationStatusCode statusCode; 157if (statusCode > NegotiateAuthenticationStatusCode.ContinueNeeded || challengeResponse == null) 180if (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 (164)
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 (21)
308return new UnsupportedNegotiateAuthenticationPal(clientOptions, NegotiateAuthenticationStatusCode.UnknownCredentials); 331public override unsafe byte[]? GetOutgoingBlob(ReadOnlySpan<byte> incomingBlob, out NegotiateAuthenticationStatusCode statusCode) 350statusCode = NegotiateAuthenticationStatusCode.ContinueNeeded; 629private unsafe byte[]? ProcessChallenge(ReadOnlySpan<byte> blob, out NegotiateAuthenticationStatusCode statusCode) 634statusCode = NegotiateAuthenticationStatusCode.InvalidToken; 644statusCode = NegotiateAuthenticationStatusCode.InvalidToken; 657statusCode = NegotiateAuthenticationStatusCode.InvalidToken; 664statusCode = NegotiateAuthenticationStatusCode.QopNotSupported; 672statusCode = NegotiateAuthenticationStatusCode.InvalidToken; 681statusCode = NegotiateAuthenticationStatusCode.InvalidToken; 775statusCode = NegotiateAuthenticationStatusCode.Completed; 838public override NegotiateAuthenticationStatusCode Wrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, bool _/*requestEncryption*/, out bool isEncrypted) 853return NegotiateAuthenticationStatusCode.Completed; 856public override NegotiateAuthenticationStatusCode Unwrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, out bool wasEncrypted) 867return NegotiateAuthenticationStatusCode.InvalidToken; 875return NegotiateAuthenticationStatusCode.MessageAltered; 880return NegotiateAuthenticationStatusCode.Completed; 883public override NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted) 896return NegotiateAuthenticationStatusCode.InvalidToken; 903return NegotiateAuthenticationStatusCode.MessageAltered; 906return NegotiateAuthenticationStatusCode.Completed;
System\Net\NegotiateAuthenticationPal.ManagedSpnego.cs (26)
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) 195statusCode == NegotiateAuthenticationStatusCode.Unsupported || 196statusCode == NegotiateAuthenticationStatusCode.UnknownCredentials; 224statusCode = NegotiateAuthenticationStatusCode.ContinueNeeded; 228private byte[]? ProcessSpNegoChallenge(ReadOnlySpan<byte> challenge, out NegotiateAuthenticationStatusCode statusCode) 290statusCode = NegotiateAuthenticationStatusCode.InvalidToken; 306statusCode = NegotiateAuthenticationStatusCode.Unsupported; 328statusCode = NegotiateAuthenticationStatusCode.InvalidToken; 338if (statusCode != NegotiateAuthenticationStatusCode.ContinueNeeded && 339statusCode != NegotiateAuthenticationStatusCode.Completed) 357if (statusCode == NegotiateAuthenticationStatusCode.Completed) 369statusCode = state == NegState.RequestMic ? NegotiateAuthenticationStatusCode.ContinueNeeded : NegotiateAuthenticationStatusCode.Completed; 370_isAuthenticated = statusCode == NegotiateAuthenticationStatusCode.Completed; 392statusCode = NegotiateAuthenticationStatusCode.GenericFailure; 398statusCode = NegotiateAuthenticationStatusCode.MessageAltered; 407NegState.AcceptCompleted => NegotiateAuthenticationStatusCode.Completed, 408NegState.AcceptIncomplete => NegotiateAuthenticationStatusCode.ContinueNeeded, 409NegState.Reject => NegotiateAuthenticationStatusCode.UnknownCredentials, 410_ => NegotiateAuthenticationStatusCode.GenericFailure 416public override NegotiateAuthenticationStatusCode Wrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, bool requestEncryption, out bool isEncrypted) 426public override NegotiateAuthenticationStatusCode Unwrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, out bool wasEncrypted) 436public override NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted)
System\Net\NegotiateAuthenticationPal.Unix.cs (42)
47NegotiateAuthenticationStatusCode statusCode = NegotiateAuthenticationStatusCode.Unsupported; 52if (statusCode <= NegotiateAuthenticationStatusCode.GenericFailure) 54statusCode = NegotiateAuthenticationStatusCode.Unsupported; 72NegotiateAuthenticationStatusCode statusCode = NegotiateAuthenticationStatusCode.Unsupported; 77if (statusCode <= NegotiateAuthenticationStatusCode.GenericFailure) 79statusCode = NegotiateAuthenticationStatusCode.Unsupported; 355public override byte[]? GetOutgoingBlob(ReadOnlySpan<byte> incomingBlob, out NegotiateAuthenticationStatusCode statusCode) 390if (statusCode >= NegotiateAuthenticationStatusCode.GenericFailure) 404if (statusCode == NegotiateAuthenticationStatusCode.Completed) 419public override NegotiateAuthenticationStatusCode Wrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, bool requestEncryption, out bool isEncrypted) 437return NegotiateAuthenticationStatusCode.GenericFailure; 442return NegotiateAuthenticationStatusCode.Completed; 450public override NegotiateAuthenticationStatusCode Unwrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, out bool wasEncrypted) 463Interop.NetSecurityNative.Status.GSS_S_BAD_SIG => NegotiateAuthenticationStatusCode.MessageAltered, 464_ => NegotiateAuthenticationStatusCode.InvalidToken 470return NegotiateAuthenticationStatusCode.Completed; 478public override unsafe NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted) 493Interop.NetSecurityNative.Status.GSS_S_BAD_SIG => NegotiateAuthenticationStatusCode.MessageAltered, 494_ => NegotiateAuthenticationStatusCode.InvalidToken 501return NegotiateAuthenticationStatusCode.Completed; 673private NegotiateAuthenticationStatusCode InitializeSecurityContext( 779NegotiateAuthenticationStatusCode.Completed : 780NegotiateAuthenticationStatusCode.ContinueNeeded; 785return NegotiateAuthenticationStatusCode.GenericFailure; 793private NegotiateAuthenticationStatusCode AcceptSecurityContext( 835NegotiateAuthenticationStatusCode errorCode; 846errorCode = NegotiateAuthenticationStatusCode.Completed; 850errorCode = NegotiateAuthenticationStatusCode.ContinueNeeded; 859return NegotiateAuthenticationStatusCode.GenericFailure; 868internal static NegotiateAuthenticationStatusCode GetErrorCode(Interop.NetSecurityNative.GssApiException exception) 873return NegotiateAuthenticationStatusCode.UnknownCredentials; 875return NegotiateAuthenticationStatusCode.BadBinding; 877return NegotiateAuthenticationStatusCode.CredentialsExpired; 879return NegotiateAuthenticationStatusCode.InvalidToken; 881return NegotiateAuthenticationStatusCode.InvalidCredentials; 883return NegotiateAuthenticationStatusCode.MessageAltered; 886return NegotiateAuthenticationStatusCode.Unsupported; 892return NegotiateAuthenticationStatusCode.TargetUnknown; 894return NegotiateAuthenticationStatusCode.GenericFailure; 897return 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 (31)
104/// To determine whether authentication actually succeeded, inspect the <see cref="NegotiateAuthenticationStatusCode" /> 105/// returned by the most recent call to <see cref="GetOutgoingBlob(ReadOnlySpan{byte}, out NegotiateAuthenticationStatusCode)" /> 106/// or <see cref="GetOutgoingBlob(string, out NegotiateAuthenticationStatusCode)" />. The status is 107/// <see cref="NegotiateAuthenticationStatusCode.Completed" /> on success; any other value indicates that 230/// Successful step of the authentication returns either <see cref="NegotiateAuthenticationStatusCode.Completed" /> 231/// or <see cref="NegotiateAuthenticationStatusCode.ContinueNeeded" /> status codes. 234/// When <see cref="NegotiateAuthenticationStatusCode.ContinueNeeded" /> is returned the 237public byte[]? GetOutgoingBlob(ReadOnlySpan<byte> incomingBlob, out NegotiateAuthenticationStatusCode statusCode) 247if (statusCode == NegotiateAuthenticationStatusCode.Completed) 251statusCode = NegotiateAuthenticationStatusCode.TargetUnknown; 255statusCode = NegotiateAuthenticationStatusCode.ImpersonationValidationFailed; 259statusCode = NegotiateAuthenticationStatusCode.SecurityQosFailed; 263statusCode = NegotiateAuthenticationStatusCode.SecurityQosFailed; 280/// Successful step of the authentication returns either <see cref="NegotiateAuthenticationStatusCode.Completed" /> 281/// or <see cref="NegotiateAuthenticationStatusCode.ContinueNeeded" /> status codes. 284/// When <see cref="NegotiateAuthenticationStatusCode.ContinueNeeded" /> is returned the 287public string? GetOutgoingBlob(string? incomingBlob, out NegotiateAuthenticationStatusCode statusCode) 298statusCode = NegotiateAuthenticationStatusCode.InvalidToken; 332/// <see cref="NegotiateAuthenticationStatusCode.Completed" /> on success, other 333/// <see cref="NegotiateAuthenticationStatusCode" /> values on failure. 342public NegotiateAuthenticationStatusCode Wrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, bool requestEncryption, out bool isEncrypted) 361/// <see cref="NegotiateAuthenticationStatusCode.Completed" /> on success. 362/// <see cref="NegotiateAuthenticationStatusCode.MessageAltered" /> if the message signature was 364/// <see cref="NegotiateAuthenticationStatusCode.InvalidToken" /> if the wrapped message was 366/// Other <see cref="NegotiateAuthenticationStatusCode" /> values on failure. 369public NegotiateAuthenticationStatusCode Unwrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, out bool wasEncrypted) 389/// <see cref="NegotiateAuthenticationStatusCode.Completed" /> on success. 390/// <see cref="NegotiateAuthenticationStatusCode.MessageAltered" /> if the message signature was 392/// <see cref="NegotiateAuthenticationStatusCode.InvalidToken" /> if the wrapped message was 394/// Other <see cref="NegotiateAuthenticationStatusCode" /> values on failure. 397public NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted)
System\Net\Security\NegotiateStream.cs (31)
394NegotiateAuthenticationStatusCode statusCode; 405statusCode = NegotiateAuthenticationStatusCode.InvalidToken; 411statusCode = NegotiateAuthenticationStatusCode.Completed; 419if (statusCode != NegotiateAuthenticationStatusCode.Completed) 528NegotiateAuthenticationStatusCode statusCode; 536statusCode = NegotiateAuthenticationStatusCode.Completed; 543if (statusCode != NegotiateAuthenticationStatusCode.Completed) 761NegotiateAuthenticationStatusCode statusCode = NegotiateAuthenticationStatusCode.Completed; 767if (statusCode is NegotiateAuthenticationStatusCode.BadBinding or 768NegotiateAuthenticationStatusCode.TargetUnknown or 769NegotiateAuthenticationStatusCode.ImpersonationValidationFailed or 770NegotiateAuthenticationStatusCode.SecurityQosFailed) 774NegotiateAuthenticationStatusCode.BadBinding => 776NegotiateAuthenticationStatusCode.TargetUnknown => 778NegotiateAuthenticationStatusCode.ImpersonationValidationFailed => 790else if (statusCode == NegotiateAuthenticationStatusCode.Completed) 820else if (statusCode != NegotiateAuthenticationStatusCode.ContinueNeeded) 824NegotiateAuthenticationStatusCode.BadBinding => (int)Interop.SECURITY_STATUS.BadBinding, 825NegotiateAuthenticationStatusCode.Unsupported => (int)Interop.SECURITY_STATUS.Unsupported, 826NegotiateAuthenticationStatusCode.MessageAltered => (int)Interop.SECURITY_STATUS.MessageAltered, 827NegotiateAuthenticationStatusCode.ContextExpired => (int)Interop.SECURITY_STATUS.ContextExpired, 828NegotiateAuthenticationStatusCode.CredentialsExpired => (int)Interop.SECURITY_STATUS.CertExpired, 829NegotiateAuthenticationStatusCode.InvalidCredentials => (int)Interop.SECURITY_STATUS.LogonDenied, 830NegotiateAuthenticationStatusCode.InvalidToken => (int)Interop.SECURITY_STATUS.InvalidToken, 831NegotiateAuthenticationStatusCode.UnknownCredentials => (int)Interop.SECURITY_STATUS.UnknownCredentials, 832NegotiateAuthenticationStatusCode.QopNotSupported => (int)Interop.SECURITY_STATUS.QopNotSupported, 833NegotiateAuthenticationStatusCode.OutOfSequence => (int)Interop.SECURITY_STATUS.OutOfSequence, 839NegotiateAuthenticationStatusCode.InvalidCredentials => 895_context.GetOutgoingBlob(message, out NegotiateAuthenticationStatusCode statusCode); 896_remoteOk = statusCode is NegotiateAuthenticationStatusCode.Completed;
System.ServiceModel.Primitives (9)
System\ServiceModel\Security\WindowsSspiNegotiation.cs (9)
159NegotiateAuthenticationStatusCode statusCode = auth.Unwrap(encryptedContent, outputWriter, out _); 161if (statusCode != NegotiateAuthenticationStatusCode.Completed) 181NegotiateAuthenticationStatusCode statusCode = auth.Wrap(input, outputWriter, true, out _); 183if (statusCode != NegotiateAuthenticationStatusCode.Completed) 197NegotiateAuthenticationStatusCode statusCode; 201if (statusCode == NegotiateAuthenticationStatusCode.Completed) 205else if (statusCode == NegotiateAuthenticationStatusCode.ContinueNeeded) 212if (statusCode == NegotiateAuthenticationStatusCode.TargetUnknown || 213statusCode == NegotiateAuthenticationStatusCode.UnknownCredentials)