Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EDR token refresh implementation is inconsistent and deviates from the documentation #1565

Open
Sebastian-Wurm opened this issue Sep 18, 2024 · 0 comments
Labels
bug Something isn't working triage all new issues awaiting classification

Comments

@Sebastian-Wurm
Copy link

Sebastian-Wurm commented Sep 18, 2024

Describe the bug

On API consumer side, the method TokenRefreshHandlerImpl.createTokenRefreshRequest() adds the "Content-Type" header "application/x-www-form-urlencoded" to the token refresh request, but adds the parameters "grant_type" and "refresh_token" as query parameters of the URL rather than as urlencoded body.

On API provider side, the method TokenRefreshApiController.refreshToken() also adds the parameters as query parameters.

The corresponding documention correctly adds these parameters as urlencoded body in the HTTP request.

To Reproduce

Adding the "Content-Type" header "application/x-www-form-urlencoded", which describes the format of the HTTP body, and providing a zero-length HTTP body is inconsistent. The implementation also deviates from the documentation. Additionally, this leads to an incompatibility between EDC 0.7.2 and 0.7.3 when refreshing the EDR token, which is why we found this issue.

Expected behavior

Either send/receive the parameters as urlencoded body or remove the "Content-Type" header "application/x-www-form-urlencoded" and adapt the documentation. As tokens tend to be long and different environments may have different restrictions regarding URL length, it's probably the better idea to urlencode the parameters in the body as defined in the documentation.

Screenshots/Error Messages

N/A

Context Information

  • Used version: EDC 0.7.2 and 0.7.3 (but seems still to be on main, too)

Please be aware, that fixing this according to either of the proposals mentioned as expected behavior again breaks the EDR token refresh. So, best is to keep this as a known issue until the first major release of Tractus-X EDC.

Possible Implementation

Use URLEncoder.

@Sebastian-Wurm Sebastian-Wurm added bug Something isn't working triage all new issues awaiting classification labels Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage all new issues awaiting classification
Projects
None yet
Development

No branches or pull requests

1 participant