guacamole-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul A <>
Subject RE: Sending private-key in json (using API to open session)
Date Wed, 01 May 2019 12:41:40 GMT
Hi Mike

Thanks for getting back to me, appreciate it.

I have put \n at the end of each line – and confirmed with 3 online JSON
validators that its valid JSON. Yet its still not working- keeps asking for
passphrase key.

The issue isn’t the JSON being generated, at the moment I am manually doing
it to confirm its working, and then passing it through your
script to get the output and put that into https://<GACAMOLE>/#/?tokens
to get the token, then passing it to https://<GACAMOLE>/#/?token=
load the page. I am doing it this way to make sure it all works – and doing
this exact thing with using a json that doesn’t have a key, but has a
password works. An ssh’ing into the client machine from this exact server
while passing this rsa_dsa key (via the ssh –I RSA_DSA file) also works
(doenst ask for a password).

So from this, I know the key works using ssh directly, and I know the API
works, and the json file format works when not using a multi line key. But
adding the 2 together fails.

So I am stuck and frustrated as to where else I can look to a resolution.

Thanks again


*From:* Mike Jumper []
*Sent:* Wednesday, 1 May 2019 3:26 AM
*Subject:* Re: Sending private-key in json (using API to open session)

Hi Paul,

Ultimately, you will need to ensure the JSON is valid JSON. The issue
you're seeing is not due to something specific to Guacamole - you're simply
getting low-level parse errors because the JSON is invalid. It's difficult
to see where exactly the failure lies in the censored JSON snippet, but

1. Make sure you do not have line breaks within the string. You can have
newlines within a string value, but these need to be represented as "\n".
You don't need to use Windows-style "\r\n" - "\n" will do.

2. Make sure you have not accidentally entered a double-quote within the
string which would cause the string to end and the rest of its value to be
interpreted as raw JSON. I don't believe the private key value would ever
normally have such a character in it, but the solution if it were needed
would be to backslash escape it. The same goes for other characters that
JSON would assign special meaning to within strings, like backslashes

If you still see JSON parse failures after this, I suggest opening things
up in a text editor which will not wrap lines, so you can easily tell
whether your private key line still contains line breaks. You might also
try pasting the JSON into a JSON validator, which might give help you find
the specific part in your file that is failing.

If you will be programmatically generating the JSON in practice, the JSON
library you use should take care of automatically and correctly escaping
string values.

- Mike

On Tue, Apr 30, 2019 at 4:36 AM Paul A <> wrote:


Does anyone have any ideas on storing the private-key in the json, that
Guacamole can actually read?





Thanks for replying quickly. What about the encoding of the data, and
encrypting it with the key? Before you can send data to that URL (same as
what we send ours to), you need to do those 2 things, which is done as an
example with the file (provided by Mike)

I gave it a go though I tired to just put some data and got this in postman:


    "message": "Permission denied.",

    "translatableMessage": {

        "key": "Permission denied.",

        "variables": null


    "statusCode": null,

    "expected": [],



And this in the log file:

[http-nio-8080-exec-20] WARN  o.a.g.r.auth.AuthenticationService -
Authentication attempt from [] for user "paul" failed.

-----Original Message-----

From: sciUser [

Sent: Friday, 26 April 2019 5:10 PM


Subject: Re: Sending private-key in json (using API to open session)

How we do it:

We use curl to post :

curl -X POST -H 'Content-Type: application/x-www-form-urlencoded' -d


This will generate a one time token for that user to login with then it
will expire, but the connection will remain as long as the session is
active in the browser.  The return/redirect link should look like this:


Our Provisioning system does all this on the fly and manages Guacamole

Hope this helps.

Thank You


Sent from:


View raw message