Hello,
Based on what you asked I interpreted it as you want to be able to authenticate to Azure AD from Shiny. Just from some quick research I have found the following documentation:
Authenticating from Shiny (for Azure AD Token)
https://cloud.r-project.org/web/packages/AzureAuth/vignettes/shiny.html
Because a Shiny app has separate UI and server components, the interactive authentication flows require some changes. In particular, the authorization step (logging in to Azure) has to be conducted separately from the token acquisition step.
If this is helpful please accept answer.