Description
When attempting to save credentials or log in using the Confluent CLI on a host without a web browser to connect to Confluent Cloud, it is possible to run into the following error:
xdg-open: no method available for opening '<url>'
Error: unable to open web browser for authorization: exit status 3
Applies To
Confluent CLI
Confluent Cloud
Cause
The CLI will attempt to open a browser to authenticate when SSO is enabled, as it will attempt to navigate to login.confluent.io
to follow the SSO flow by generating a signed id_token
. If no web browsers are installed on the node, it will fail to open a web browser and generate the error Error: unable to open web browser for authorization: exit status 3
Resolution
Run the command with the --no-browser
flag as follows:
confluent login --no-browser
After running this command, you will receive a URL which must be copied to a local browser, where you will be able to provide your SSO credentials to login. The browser will then display a code which. must be copied back into the Confluent CLI.
You can see a complete example of this flow in the documentation here.