Hi!
We are using REST API endpoints to populate the views in NocoBase from our backend. The endpoints use token authorization for security. NocoBase users login using SSO. The two authorization mechanisms are completely separate.
For audit logging in the backend I want to track which NocoBase user triggered the REST API request. I thought it could done by including a header with the relevant field, e.g. “X-Username”, but that is not an option it seems:

Perhaps this is not possible for security reasons. What are the alternatives for sending the NocoBase username in a REST API request?
Cheers,
Kevin
what is the type of workflow trigger that you’re using? maybe you can use a webhook type like my plugin @bunnarin/plugin-workflow-endpoint because it has a user field.
or better yet, you can ditch the workflow stuff altogether and just write server side code via @bunnarin/plugin-hooks if you’re more comfortable with code
Hi Bunnarin,
that could work, but before proceeding I would like to know if there is a native solution to this, now or in future.
Cheers,
Kevin
well, you probably can use a JSON variable node that takes in the headers object, and then you can manually write {“x-username”: “admin”} to make it expose x-username as a variable tht can be used in subsequent nodes
When you say “nodes”, are you talking about workflows? Workflows are not involved here. It is just the REST API data source that I am trying to configure the request headers for. The screenshot above is where the header parameters are configured for a REST API request.
oh sorry, it’s just that I never configured a rest-api data sourcce before. I thought it was a workflow
One work around is to find where the setting is stored in the main database and then manually edit it to be “X-Username”