Skip to content

Commit

Permalink
fix: fetch endpoint error json response
Browse files Browse the repository at this point in the history
  • Loading branch information
peppelinux committed Feb 4, 2025
1 parent e1bc649 commit 6673a7c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion spid_cie_oidc/authority/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@ def fetch(request):
sub=request.GET["sub"], is_active=True
).first()
if not sub:
raise Http404()
return JsonResponse(
{
"error": "invalid_subject",
"error_description": "entity not found"
}, status = 404
)

if request.GET.get("format") == "json":
return JsonResponse(
Expand Down
4 changes: 2 additions & 2 deletions spid_cie_oidc/entity/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def resolve_entity_statement(request, format: str = "jose"):
{
"error": "invalid_request",
"error_description": "sub and trust_anchor parameters are REQUIRED."
}, status=404
}, status=401
)

iss = FederationEntityConfiguration.objects.filter(is_active=True).first()
Expand Down Expand Up @@ -127,7 +127,7 @@ def resolve_entity_statement(request, format: str = "jose"):
{
"error": "invalid_subject",
"error_description": "entity not found"
}, status=404
}, status = 404
)

res = {
Expand Down

0 comments on commit 6673a7c

Please sign in to comment.