59 references to Status401Unauthorized
Microsoft.AspNetCore.Authentication.Negotiate (2)
NegotiateHandler.cs (2)
179Response.StatusCode = StatusCodes.Status401Unauthorized; 391Response.StatusCode = StatusCodes.Status401Unauthorized;
Microsoft.AspNetCore.Authentication.Negotiate.Test (11)
EventTests.cs (4)
41Assert.Equal(StatusCodes.Status401Unauthorized, result.Response.StatusCode); 339Assert.Equal(StatusCodes.Status401Unauthorized, result.Response.StatusCode); 363Assert.Equal(StatusCodes.Status401Unauthorized, result.Response.StatusCode); 398Assert.Equal(StatusCodes.Status401Unauthorized, result.Response.StatusCode);
NegotiateHandlerTests.cs (7)
60Assert.Equal(StatusCodes.Status401Unauthorized, result.Response.StatusCode); 72Assert.Equal(StatusCodes.Status401Unauthorized, result.Response.StatusCode); 82Assert.Equal(StatusCodes.Status401Unauthorized, result.Response.StatusCode); 191Assert.Equal(StatusCodes.Status401Unauthorized, result.Response.StatusCode); 300Assert.Equal(StatusCodes.Status401Unauthorized, result.Response.StatusCode); 349Assert.Equal(StatusCodes.Status401Unauthorized, result.Response.StatusCode); 369Assert.Equal(StatusCodes.Status401Unauthorized, result.Response.StatusCode);
Microsoft.AspNetCore.Grpc.JsonTranscoding (1)
Internal\JsonRequestHelpers.cs (1)
143return StatusCodes.Status401Unauthorized;
Microsoft.AspNetCore.Http.Results (8)
Results.cs (2)
31/// <see cref="StatusCodes.Status401Unauthorized"/> and <see cref="StatusCodes.Status403Forbidden"/> 613/// Produces a <see cref="StatusCodes.Status401Unauthorized"/> response.
ResultsCache.StatusCodes.cs (2)
110StatusCodes.Status401Unauthorized => _status401Unauthorized ??= new(StatusCodes.Status401Unauthorized),
TypedResults.cs (2)
31/// <see cref="StatusCodes.Status401Unauthorized"/> and <see cref="StatusCodes.Status403Forbidden"/> 667/// Produces a <see cref="StatusCodes.Status401Unauthorized"/> response.
UnauthorizedHttpResult.cs (2)
23/// Gets the HTTP status code: <see cref="StatusCodes.Status401Unauthorized"/> 25public int StatusCode => StatusCodes.Status401Unauthorized;
Microsoft.AspNetCore.Http.Results.Tests (5)
ResultsTests.cs (1)
1685Assert.Equal(StatusCodes.Status401Unauthorized, result.StatusCode);
TypedResultsTests.cs (1)
1464Assert.Equal(StatusCodes.Status401Unauthorized, result.StatusCode);
UnauthorizedResultTests.cs (3)
19Assert.Equal(StatusCodes.Status401Unauthorized, result.StatusCode); 34Assert.Equal(StatusCodes.Status401Unauthorized, httpContext.Response.StatusCode); 53Assert.Equal(StatusCodes.Status401Unauthorized, result.StatusCode);
Microsoft.AspNetCore.Identity (1)
IdentityApiEndpointRouteBuilderExtensions.cs (1)
115return TypedResults.Problem(result.ToString(), statusCode: StatusCodes.Status401Unauthorized);
Microsoft.AspNetCore.Mvc.Core (8)
ControllerBase.cs (6)
1711/// Creates an <see cref="UnauthorizedResult"/> that produces a <see cref="StatusCodes.Status401Unauthorized"/> response. 1719/// Creates an <see cref="UnauthorizedObjectResult"/> that produces a <see cref="StatusCodes.Status401Unauthorized"/> response. 2322/// <see cref="StatusCodes.Status401Unauthorized"/> and <see cref="StatusCodes.Status403Forbidden"/> 2336/// <see cref="StatusCodes.Status401Unauthorized"/> and <see cref="StatusCodes.Status403Forbidden"/> 2351/// <see cref="StatusCodes.Status401Unauthorized"/> and <see cref="StatusCodes.Status403Forbidden"/> 2368/// <see cref="StatusCodes.Status401Unauthorized"/> and <see cref="StatusCodes.Status403Forbidden"/>
UnauthorizedObjectResult.cs (1)
15private const int DefaultStatusCode = StatusCodes.Status401Unauthorized;
UnauthorizedResult.cs (1)
16private const int DefaultStatusCode = StatusCodes.Status401Unauthorized;
Microsoft.AspNetCore.Mvc.Core.Test (2)
ControllerBaseTest.cs (1)
1973Assert.Equal(StatusCodes.Status401Unauthorized, result.StatusCode);
HttpUnauthorizedResultTests.cs (1)
17Assert.Equal(StatusCodes.Status401Unauthorized, result.StatusCode);
Microsoft.AspNetCore.Mvc.RazorPages (10)
PageBase.cs (5)
156/// <see cref="StatusCodes.Status401Unauthorized"/> and <see cref="StatusCodes.Status403Forbidden"/> 169/// <see cref="StatusCodes.Status401Unauthorized"/> and <see cref="StatusCodes.Status403Forbidden"/> 183/// <see cref="StatusCodes.Status401Unauthorized"/> and <see cref="StatusCodes.Status403Forbidden"/> 199/// <see cref="StatusCodes.Status401Unauthorized"/> and <see cref="StatusCodes.Status403Forbidden"/> 1159/// Creates an <see cref="UnauthorizedResult"/> that produces an <see cref="StatusCodes.Status401Unauthorized"/> response.
PageModel.cs (5)
488/// <see cref="StatusCodes.Status401Unauthorized"/> and <see cref="StatusCodes.Status403Forbidden"/> 501/// <see cref="StatusCodes.Status401Unauthorized"/> and <see cref="StatusCodes.Status403Forbidden"/> 515/// <see cref="StatusCodes.Status401Unauthorized"/> and <see cref="StatusCodes.Status403Forbidden"/> 531/// <see cref="StatusCodes.Status401Unauthorized"/> and <see cref="StatusCodes.Status403Forbidden"/> 1516/// Creates an <see cref="UnauthorizedResult"/> that produces an <see cref="StatusCodes.Status401Unauthorized"/> response.
Microsoft.AspNetCore.Mvc.RazorPages.Test (2)
PageModelTest.cs (1)
1503Assert.Equal(StatusCodes.Status401Unauthorized, result.StatusCode);
PageTest.cs (1)
1493Assert.Equal(StatusCodes.Status401Unauthorized, result.StatusCode);
Microsoft.AspNetCore.OutputCaching.Tests (1)
OutputCachePolicyProviderTests.cs (1)
279[InlineData(StatusCodes.Status401Unauthorized)]
Microsoft.AspNetCore.ResponseCaching.Tests (1)
ResponseCachingPolicyProviderTests.cs (1)
305[InlineData(StatusCodes.Status401Unauthorized)]
Microsoft.AspNetCore.Server.HttpSys (2)
HttpSysListener.cs (1)
290SendError(requestMemory.RequestId, StatusCodes.Status401Unauthorized,
RequestProcessing\Response.cs (1)
378if (StatusCode == StatusCodes.Status401Unauthorized)
Microsoft.AspNetCore.Server.Kestrel.Core (2)
Internal\Http\ReasonPhrases.cs (2)
39private static readonly byte[] _bytesStatus401 = CreateStatusBytes(StatusCodes.Status401Unauthorized); 125StatusCodes.Status401Unauthorized => _bytesStatus401,
Negotiate.Client (3)
Controllers\AuthTestController.cs (3)
58if (HasWrongStatusCode(StatusCodes.Status401Unauthorized, result.StatusCode, body, out var actionResult) 206if (HasWrongStatusCode(StatusCodes.Status401Unauthorized, result.StatusCode, body, out var actionResult) 243if (HasWrongStatusCode(StatusCodes.Status401Unauthorized, result.StatusCode, body, out actionResult)