You can try this

curl -X POST -H 'Content-Type: application/x-www-form-urlencoded' -d
'username=username&password=password' https://URLHERE
 
curl -X DELETE
https://GuacamoleServer:8080/Guacamole/api/tokens/1A065A4E9D59753CD427A03F8C
861B6D68B5CC245A75436707C66C234F8215E3
 


Thank You
Sean Hulbert
 
Founder / CEO
Work Ph: 925.663.5565
 
Security Centric Inc.
A Cybersecurity Virtualization Enablement Company
We don't just run you through the motions, Our labs teach you how to think!
 
 

System Award Management
CAGE: 8AUV4

AFCEA San Francisco Chapter V.P.
 
If you have heard of a hacker by name, he/she has failed, fear the hacker
you haven’t heard of!
 
CONFIDENTIALITY NOTICE: This communication with its contents may contain
confidential and/or legally privileged information. It is solely for the use
of the intended recipient(s). Unauthorized interception, review, use or
disclosure is prohibited and may violate applicable laws including the
Electronic Communications Privacy Act. If you are not the intended
recipient, please contact the sender and destroy all copies of the
communication. Content within this email communication is not legally
binding as a contract and no promises are guaranteed unless in a formal
contract outside this email communication.
 
igitur qui desiderat pacem, praeparet bellum!!!

Epitoma Rei Militaris

-----Original Message-----
From: Daniel Carroll [mailto:[email protected]] 
Sent: Tuesday, November 15, 2022 9:04 AM
To: [email protected]
Subject: Guacamole REST API question/help

Hi,

I've been using Apache Guacamole for a while now and have had quite a bot of
success with it.
Now I'm trying to use the Guacamole REST API to configure users and
connections.
I'm able to successfully query the REST API for information, but now that
I'm trying to add/update information I'm not having any success.  Would
anyone be able to give me some pointers?
I'm using the official Dockerized version of Apache Guacamole 1.4.0 from
DockerHub: https://hub.docker.com/r/guacamole/guacamole (and
guacamole/guacd) This Github repository documents the REST API that I'm
trying to follow:
https://github.com/ridvanaltun/guacamole-rest-api-documentation#api-ref

When I attempt to create a new Guacamole connection, I receiving the
following generic error in the REST response:
    Unexpected internal error

I see the following in the Tomcat logs (via 'docker logs CONTAINERID'):
  ...
  15:57:19.557 [http-nio-8080-exec-3] ERROR o.a.g.rest.RESTExceptionMapper -
An internal error occurred, but did not contain an error message. Enable
debug-level logging for details.
  15:57:19.559 [http-nio-8080-exec-3] DEBUG o.a.g.rest.RESTExceptionMapper -
Unexpected error in REST endpoint.
  java.lang.NullPointerException: null
          at
org.apache.guacamole.rest.directory.DirectoryObjectTranslator.filterAttribut
es(DirectoryObjectTranslator.java:145)
          at
org.apache.guacamole.rest.connection.ConnectionObjectTranslator.filterExtern
alObject(ConnectionObjectTranslator.java:68)
          ...

I tried setting the LOGBACK_LEVEL environment variable to debug when
creating the docker instance and that did raise the logging level, but it
hasn't provided any insight into the unhelpful "An internal error occurred,
but did not contain an error message. Enable debug-level logging for
details" message.
Also, per
https://guacamole.apache.org/doc/gug/configuring-guacamole.html#webapp-loggi
ng
I've edited logback.xml in the container and set: <appender
name="GUAC-DEBUG" ... </appender> <root level="debug"> <appender-ref
ref="GUAC-DEBUG"/> </root> That didn't provide any additional logging
information that I could see.

I've also captured the contents of the POST to create the connection and it
looks kosher.  Here's roughly what it looks like (I've edited the token and
names):

  POST /guacamole/api/session/data/mysql/connections?token=xxx...xxx
HTTP/1.1
  User-Agent: Faraday v0.14.0
  Content-Type: application/json
  Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
  Accept: */*
  Connection: close
  Host: guac.my.dns.domain
  Content-Length: 230

 
{"parentIdentifier":"ROOT","name":"XXXXX","protocol":"rdp","parameters":{"po
rt":"3389","security":"nla","ignore-cert":"true","username":"${GUAC_USERNAME
}","password":"${GUAC_PASSWORD}","hostname":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}}


Does anyone have any thoughts/suggestions as to what I need to do
differently to create connections using the REST API?
Dropping the parentIdentifier setting didn't help.
Thanks,

        - Daniel


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to