RStudio Connect: Run API as user who is accessing API

In RStudio Connect, there are options documented here to restrict access to an API to specific users. Furthermore, there are options also documented at that link where the content of the API is run as a specific user (i.e., default user rstudio-connect or an alternate user).

Is it possible to use these two options together so that the API is restricted to specific users and the content of the API is run as the user that is accessing the API? Or does the "alternate user" need to be set as a single individual user?

Could you say more about what you're trying to accomplish? Current user execution is supported for some application types, but not for APIs.

Thanks for the quick reply, David. The end goal is that I'd like to know who is accessing the API for logging/access purposes. So, when some one pings the API, if the API was running as that user then I'd have access to that information.

I realise that this is a somewhat cludgy approach to the problem, but I'm not aware of how else to determine who is accessing the API.

This should help you get that information without requiring current user execution:
https://docs.rstudio.com/connect/user/plumber/#user-meta-data

1 Like

Thanks, David. This looks like exactly what I wanted.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.