I’m currently developing an application that uses Discourse only as an API. The new feature relates to DMs, where we’re using private_messages. The issue here is that we need to receive updates from these private topics (private_messages) through the MessageBus, and currently our authentication method with Username: user.username and Api-Key: admin_api_key doesn’t work exclusively for this case of MessageBus and private topics; it works for everything else.
So we need a way to obtain and inject cookies into our frontend when calling the MessageBus, or to create a ‘user-api-key’ and user instead of the api-key. But we need to do this only via API, since our backend will communicate with the Discourse backend and provision everything. The frontend will only be responsible for receiving the cookie or user-api-key and adding it to the MessageBus request.