Skip to content
Permalink
Browse files

Fixes mixup

  • Loading branch information...
joseftw
joseftw committed Jul 18, 2019
1 parent 5e96983 commit 5bd3d1bf163b9b8c3f51cce74a2d42c4f8d1b8b9
@@ -70,7 +70,7 @@ protected override async Task HandleChallengeAsync(AuthenticationProperties prop
{
Response.StatusCode = 401;
Response.ContentType = ProblemDetailsContentType;
var problemDetails = new UnauthenticatedProblemDetails();
var problemDetails = new UnauthorizedProblemDetails();

await Response.WriteAsync(JsonConvert.SerializeObject(problemDetails));
}
@@ -79,7 +79,7 @@ protected override async Task HandleForbiddenAsync(AuthenticationProperties prop
{
Response.StatusCode = 403;
Response.ContentType = ProblemDetailsContentType;
var problemDetails = new UnauthorizedProblemDetails();
var problemDetails = new ForbiddenProblemDetails();

await Response.WriteAsync(JsonConvert.SerializeObject(problemDetails));
}

This file was deleted.

@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;

namespace JOS.ApiKeyAuthentication.Web.Features.Authorization
namespace JOS.ApiKeyAuthentication.Web.Features.Authentication
{
public class UnauthorizedProblemDetails : ProblemDetails
{
@@ -0,0 +1,15 @@
using Microsoft.AspNetCore.Mvc;

namespace JOS.ApiKeyAuthentication.Web.Features.Authorization
{
public class ForbiddenProblemDetails : ProblemDetails
{
public ForbiddenProblemDetails(string details = null)
{
Title = "Forbidden";
Detail = details;
Status = 403;
Type = "https://httpstatuses.com/403";
}
}
}

0 comments on commit 5bd3d1b

Please sign in to comment.
You can’t perform that action at this time.