Enhancement
Major
#28564
OpenAPI: Accept authorization token, even if it contains no user information
An authorization token may also be issued for a technical user (with only client credentials). API requests with such a token should not generally be rejected.
A token introspection response could look like:
{ "active":true, "client_type": "confidential", "token_type": "Bearer", "exp":1742811704, "client_id": "XXXXXXXXXXXXXXXXXX" }
The authorization information could also be made available to the executing script. In the script above, access checks could be required depending on the authenticated client ID.
On the other hand, for requests that are not handled in user context (for which no application user can be identified), it could be beneficial, if the request could be mapped to a system user in which context the request is executed and which is available for checking roles an permissions.
Improvement
- A technical user account can be configured for an API key. Requests for this API key are then executed in the context of this user account.
- With OpenID authentication, a mapping from client ID to technical user can be configured if authentication is to take place in the user context. If the token introspection response does not provide a user name, a technical user name is searched for the client ID in the context of which the request is to be processed.
Test
- Configure API with OpenID authentication in user context and mapping of client ID to technical user. Request API with token without user context.
- Configure API key with technical user and make request with this API key.