Closed jeffkeller87 closed 4 years ago
Additional info: our RStudio Connect installation uses SAML to integrate with Okta for account management.
The Shiny team would like to use this feature and are running into this issue as well.
(Getting the accountId
would get the team unstuck.)
rsconnect::connectApiUser(
"barret",
"beta.rstudioconnect.com",
apiKey = "supersecretkey"
)
#>
#> Account registered successfully: barret
rsconnect::accounts()
#> name server
#> 1 barret beta.rstudioconnect.com
rsconnect::accountInfo("barret", "beta.rstudioconnect.com")
#> $username
#> [1] "barret"
#>
#> $accountId
#> [1] "0"
#>
#> $apiKey
#> [1] "supersecretkey"
#>
#> $server
#> [1] "beta.rstudioconnect.com"
Understood, I will be starting work on this on Feb 22 and will update with my progress.
I am still having issues with connectUserApi()
using rsconnect
0.8.17. It now correctly generates a .dcf
account file with a non-zero account ID, but when I attempt to deploy a document, I get a 404 error from the Connect server.
> rsconnect::deployDoc(doc = "test.Rmd")
# Discovering document dependencies... OK
# Preparing to deploy document...Error: HTTP 404
# GET https://connect.decision-science.io/applications/483
Reconnecting the account via the RStudio GUI allows me to publish as expected, but this has the effect of modifying the account .dcf
file to use a token and private key rather than the API key.
Possibly related to #507.
I got this working. The server URL in my original example was incomplete. It needs the /__api__
path:
rsconnect::addServer(url = "https://connect.my-company.io/__api__", name = "connect.my-company.io")
rsconnect::connectApiUser(account = "jeff.keller@my-company.com", server = "connect.my-company.io", apiKey = "MY_KEY")
I got this working. The server URL in my original example was incomplete. It needs the
/__api__
path:rsconnect::addServer(url = "https://connect.my-company.io/__api__", name = "connect.my-company.io") rsconnect::connectApiUser(account = "jeff.keller@my-company.com", server = "connect.my-company.io", apiKey = "MY_KEY")
Thank you for sharing your solution @jeffkeller87 - nearly 2 years later and I've run into the exact same issue and adding /__api__
to path resolved for me as well. Wish this was better documented.
The rsconnect::addConnectServer
function helps make sure that the Connect URL includes /__api__
. Agreed that we should include additional/better examples and documentation.
The
rsconnect::connectApiUser
function doesn't appear to generate a usable account configuration.This generates the file
with contents
Which doesn't work for publishing content to Connect. If I "reconnect" the account through the RStudio GUI, the contents of the
.dcf
file become:Which works fine for publishing. How can I use
rsconnect:connectApiUser
to publish content without authenticating via the browser?Software versions
rsconnect
v0.8.16 RStudio Connect v1.7.8-7 Build "1144ac9"