Prismic CLI Login over SSH

The CLI seems to have changed, I used to be able to put my email and password in and it logged in, now it wants to open the browser.
The problem is I work on a remote development box, so my terminal has an SSH connection to that box and when it says that it's opening the browser, nothing happens.

2 Likes

Hi Ben,

Welcome to the community!

I've reached out to the devs to get more information about this. Once I have more info I'll update you here.

Thanks.

Hi Ben,

Keeping the ability to login with email + password was discussed, but we decided to deprecate it (I would like to keep it) but it's a very niche use case.

Although there is something that I would like to try and to see if it works :slight_smile:

First of I'm assuming you're using linux,
Install a console based browser here's a small selection List of applications - ArchWiki),
pick one that supports javascript like browsh or elinks (disabled by default)

the set that as you're default browser (assuming browsh https://www.brow.sh/
)
xdg-settings set default-web-browser browsh

Then try to login again, and it should open a console based browser :slight_smile:

if you do try this, can you let me know it it goes?

Best,
Marc

1 Like

This thread has been closed due to inactivity. Flag to reopen.

The proposed solution does not work @marc.mcintosh

I also tried with other text-based browsers like w3m and elinks with no luck. The login keeps waiting for the browser and no text-based browser is launched.

Currently there is no way to login in non GUI environments like SSH, Docker, no-GUI SOs, etc.

This makes my development workflow (which is docker-based) not work as desired. I need to have prismic and slicemachine installed on my host machine, while my app is using docker to install own dependencies and to run.

Making all work together like this is not straightforward, is there any plan to improve support for these environments?

Thanks

1 Like

Hi Javi,

The team are discussing this issue at length and will get back to you with a response soon.

Thanks.

I await their response with bated breath. Currently, I have to switch my screen to the Linux box under my desk, attach a keyboard, and then mess about logging in. It's really annoying, but I'm lucky I even have that sort of access to the box.

Hi @marc.mcintosh ,

I have tried the proposed solution and I can't log in either.

Have you found a temporary solution?

Thank you.

Best regards.

Hi guys,

I have found a solution using Browsh!

To install Browsh follow the instructions in the following link Installation - Browsh

# Debian/Ubuntu
wget https://github.com/browsh-org/browsh/releases/download/v1.6.4/browsh_1.6.4_linux_amd64.deb
sudo apt install ./browsh_1.6.4_linux_amd64.deb
rm ./browsh_1.6.4_linux_amd64.deb

It is also necessary to have installed xdg-utils

sudo apt-get install xdg-utils

After, exec in one terminal

#Shell 1
prismic login

in another terminal exec

#Sehll 2
browsh --startup-url https://prismic.io/dashboard/cli/login?port=5555

and input your credentials in form (GitHub or eMail).

Congratulations, you are now logged in.

If the following error,

Error starting websocket server: listen tcp :3334: bind: address already in use

appears when executing the browsh command, exec:

kill $(pidof firefox)

and re-launch the above command.

I hope it helps.

Best regards

2 Likes

Hi José,

Thanks for offering this solution, this will really other users.

The team is still discussing this because there are certain security issues that the team needs be careful of when it comes to login over SSH.

Once they've made any decisions we'll update everyone here.

Thanks.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.