Posted on 28/11/2025 14:56:43
Hi Anders,
A 400 bad request error would usually occur if...
1. The "Authorization" header is empty or the value cannot be parsed (scheme, parameter).
2. The user cannot be resolved from the provided token. This is done internally by calling JwtService.GetPrincipal(token) which parses the token, tries to lookup the user and then generates a claims principle from that user.
3. The user doesn't have the required permissions to the requested resource, e.g. making a GET request for something where the user doesn't have the required Read permission.
If the issue only occurs for endpoints with PermissionFilter then 3 is probably the cause.
Otherwise, try to check if the issue could be related to any of the following...
A. It seems that you currently need to restart the application after changing the JWT configuration settings
/Globalsettings/Modules/Users/Jwt/UseFixedSecret
/Globalsettings/Modules/Users/Jwt/Secret
This is probably unintended. I'll need to get that confirmed.
Note: The secret must be exactly 32 characters long for this to work.
B. When UseFixedSecret mode is enabled the token generation and validation is different from how it works in the normal mode (default).
The normal mode will use the user id as identifier in the token, but the fixed secret mode will use the username as identifier in the token.
The identifier in the token is used for looking up the actual user in the request.
If you have multiple users with the same username then it might not work as expected.
I'm not sure why this part of the token handling is different. I'll need to ask someone else about that.
If you still can't find the cause of the issue then please provide some more details (DW version, api endpoint, request/response examples) and we can take a closer look at it.
/Morten