I am trying to use the suitecloud-cli npm package ...
# sdf
b
I am trying to use the suitecloud-cli npm package to authenticate with a netsuite environment. When I run "suitecloud account:setup", I then enter the authid, and the command errors and says "Web browsing is not supported on this device". Any idea how I can get this working? I am on a linux laptop currently.
r
There is an open issue about this here: https://github.com/oracle/netsuite-suitecloud-sdk/issues/698 The advice in that thread is to use the account:savetoken command which has been removed in the newest version. It might be possible to use the new accountsetupci command but I'm still on the older version so I haven't tested it myself. Alternatively you should be able to downgrade to the latest version which still has the account:savetoken command.
b
Yeah, I did see that. I dug through the source code a bit and found that the cli is using a jar file. I decompiled the jar file and found the following lines that I think may be the issue.
Copy code
private void requestCodeGrant(URI authUrl) throws IOException, PKCEException {
        if (!Desktop.isDesktopSupported() || !Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
            throw new PKCEException(Messages.msg_oauth_browser_not_supported);
        }
        if (SystemUtils.IS_OS_LINUX) {
            Runtime.getRuntime().exec(XDG_OPEN_COMMAND + authUrl);
        } else {
            Desktop.getDesktop().browse(authUrl);
        }
    }
That was the issue. Apparently the Desktop class is not supported very well on Linux and in order for it to work you have to have libgnome2 installed. After installing libgnome2, everything worked as expected!