How to do the guacamole login in the back-end?

i want to display the terminal of my remote device inside my phoennix application using Apache Guacamole, so i added an iframe inside my code:

<div id="ssh-container" class="mb-2">
    <iframe src="xxxx.com" id="terminal-dev" name="terminal-dev" height="500px" width="100%" title="terminal-dev"></iframe>
</div>

it’s will be like this: enter image description here

so, my question is: how i can do the auth in the backend and pass the login here for displaying just the next page after this? i tried to do it by sending a login request in the back-end with javascript but without any result.

So I’ve searched about Apache Guacamole. It seems that you might achieve that login using the JS API, specially the HTTPTunnel function, which that the documentation says it can accept login data.

Also have a look at Writing your own Guacamole application. It is in Java and JS.

If it did not work, I understood that you would have to create an server to interface with the remote client, as in the example above using Java, but to do in Elixir, you would have to do using libguac or Jinterface

Otherwise, I would say that requiring the login for the Guacamole server, the “Device Terminal” is a nice security measure to have. If only the owner of the server can connect to it.

I made similar system with Guacamole, and i did it by including credentials directly into url
http://x.x.x.x:8080/guacamole/#/client/AySBkZWZhdy0xMFMAYwQmFyY28gRFWx0?username=user&password=password

You need to know the token of the device to use this link, but you can try to include username and password to get access to devices index, something like http://x.x.x.x:8080/guacamole/#/?username=user&password=password.

I hope it will help you.

1 Like