This How do I track user activity within a Shiny application? – RStudio Support
shows how we can capture username through session$user only when we have a shiny login page . But what is happening is, there is no shiny login page, but the organization has separate authentication (non shiny) where the user have to give credentials. Only then the user is able to access the shiny application (deployed on shiny server pro).
In this case , can we not capture sesssion$user ? When I tried it is returning NULL
Can anyone help me?
This sounds like the organization is using an authenticating reverse proxy. Does that reverse proxy add the user name as an HTTP header? If so, you can extract it from session$request.
Shiny Server Pro does not support SSO out of the box (as opposed to it's successor RStudio Connect). What you can use is proxied authentication, which requires you to forward the user name in an HTTP header. It sounds like your reverse proxy only authenticates the user via SSO but does not inform Shiny Server Pro about that.
If you don't understand these terms, it is best if you find the IT department within your organisation which is responsible for the reverse proxy. Show them the documentation linked above and ask them if they can implement something like this within the reverse proxy.