nuts-foundation / nuts-foundation/nuts-node

OAuth2 client's errors don't have enough information when returned by remote party

Open
#2,943 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Go
Stars
28
Forks
23
Avg merge
1d 10h
Merged PRs (30d)
76

Description

E.g., when requesting a PD for an unknown scope:

{
  "detail": "failed to retrieve presentation definition: server returned HTTP 400 (expected: 200)",
  "status": 500,
  "title": "RequestServiceAccessToken failed"
}
level=error msg="RequestServiceAccessToken failed" error="failed to retrieve presentation definition: server returned HTTP 400 (expected: 200)" module=Auth/iam operation=RequestServiceAccessToken operationID=RequestServiceAccessToken requestURI="/internal/auth/v2/did:web:api-gateway%3A9443/request-service-access-token" user="<nil>"

But the server logs:

level=warning msg="PresentationDefinition failed" error="invalid_scope - not found" module=Auth/iam operation=PresentationDefinition operationID=PresentationDefinition

This last error should be logged and returned to the client (calling the Nuts node)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the RequestServiceAccessToken and PresentationDefinition operations, using the unknown-scope request shown in the issue to reproduce the failure. Trace how the remote server's "invalid_scope - not found" error is handled; done means that specific error is logged and returned to the Nuts node instead of only reporting HTTP 400.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, authentication, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.