简体   繁体   中英

In a deployed shinyapp, how to get the name of the account?

can't seem to find the info. Let's say your shiny app's url is : "joe.shinyapps.io/great_app" I'm looking to get that url from within that shiny app (running on shinyapps.io).

That way, the redirect URI I use for oauth could change dynamically based on which shiny app account I deployed the app to...

Thanks for any help

I found the answer while researching packages that do use user credentials oauth and shiny (those packages must use a redirect URI that is specific to the user's app). The following bit is taken from GoogleAuthR package .

if(!is.null(session)){
        pathname <- session$clientData$url_pathname
        hostname <- session$clientData$url_hostname
        port <- session$clientData$url_port

        url <- paste0(session$clientData$url_protocol,
            "//",
            hostname,
            if(port != "") paste0(":", port),
            if(pathname != "/") pathname)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM