Search in sources :

Example 1 with RSConnectPreAuthToken

use of org.rstudio.studio.client.rsconnect.model.RSConnectPreAuthToken in project rstudio by rstudio.

the class RSAccountConnector method connectLocalAccount.

private void connectLocalAccount(final NewRSConnectAccountResult result, final ProgressIndicator indicator, final OperationWithInput<AccountConnectResult> onConnected) {
    indicator.onProgress("Adding account...");
    final RSConnectAuthUser user = result.getAuthUser();
    final RSConnectServerInfo serverInfo = result.getServerInfo();
    final RSConnectPreAuthToken token = result.getPreAuthToken();
    server_.registerUserToken(serverInfo.getName(), result.getAccountNickname(), user.getId(), token, new ServerRequestCallback<Void>() {

        @Override
        public void onResponseReceived(Void result) {
            onConnected.execute(AccountConnectResult.Successful);
        }

        @Override
        public void onError(ServerError error) {
            display_.showErrorMessage("Account Connect Failed", "Your account was authenticated successfully, but could " + "not be connected to RStudio. Make sure your installation " + "of the 'rsconnect' package is correct for the server " + "you're connecting to.\n\n" + serverInfo.getInfoString() + "\n" + error.getMessage());
            onConnected.execute(AccountConnectResult.Failed);
        }
    });
}
Also used : RSConnectAuthUser(org.rstudio.studio.client.rsconnect.model.RSConnectAuthUser) ServerError(org.rstudio.studio.client.server.ServerError) RSConnectPreAuthToken(org.rstudio.studio.client.rsconnect.model.RSConnectPreAuthToken) Void(org.rstudio.studio.client.server.Void) RSConnectServerInfo(org.rstudio.studio.client.rsconnect.model.RSConnectServerInfo)

Aggregations

RSConnectAuthUser (org.rstudio.studio.client.rsconnect.model.RSConnectAuthUser)1 RSConnectPreAuthToken (org.rstudio.studio.client.rsconnect.model.RSConnectPreAuthToken)1 RSConnectServerInfo (org.rstudio.studio.client.rsconnect.model.RSConnectServerInfo)1 ServerError (org.rstudio.studio.client.server.ServerError)1 Void (org.rstudio.studio.client.server.Void)1