You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@guacamole.apache.org by sciUser <sh...@securitycentric.net> on 2019/03/14 22:57:08 UTC

Correct Syntax for Curl

Anyone know the correct syntax for curl syntax to generate a token for a
user?


What I have so far...



Thank You





--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/

Re: Correct Syntax for Curl

Posted by sciUser <sh...@securitycentric.net>.
This worked out perfect, 
Thank you very much, I can now stop hitting my head in to the wall at least
for the weekend.

Thank You



--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/

Re: Correct Syntax for Curl

Posted by Nick Couchman <vn...@apache.org>.
On Thu, Mar 14, 2019 at 9:13 PM sciUser <sh...@securitycentric.net>
wrote:

> So here is what I get when trying to post to the /api/tokens
>
>  curl -X POST -F 'username=secretusername' -F 'password=secretpassword'
> http://localhost:8080/labview/api/tokens
> {"message":"Invalid login","translatableMessage":{"key":"Invalid
>
> login","variables":null},"statusCode":null,"expected":[{"name":"username","type":"USERNAME"},{"name":"password","type":"PASSWORD"}],"type":"INVALID_CREDENTIALS"}
>
>
Yeah apparently my guess wasn't quite so functional without some testing -
go figure.  Here's what I got to work:

# curl -X POST -H 'Content-Type: application/x-www-form-urlencoded' -d
'username=guacuser&password=guacpass'
https://example.com/guacamole/api/tokens
{"authToken":"6C1A3A80FBD40C586D3A2ABAC9A74B5486B5D34AFB12BDCD39F5E4520BA1EB22","username":"guacuser","dataSource":"postgresql","availableDataSources":["postgresql","postgresql-shared"]}
# curl -X DELETE
https://example.com/guacamole/api/tokens/6C1A3A80FBD40C586D3A2ABAC9A74B5486B5D34AFB12BDCD39F5E4520BA1EB22

-Nick

Re: Correct Syntax for Curl

Posted by sciUser <sh...@securitycentric.net>.
So here is what I get when trying to post to the /api/tokens

 curl -X POST -F 'username=secretusername' -F 'password=secretpassword'
http://localhost:8080/labview/api/tokens
{"message":"Invalid login","translatableMessage":{"key":"Invalid
login","variables":null},"statusCode":null,"expected":[{"name":"username","type":"USERNAME"},{"name":"password","type":"PASSWORD"}],"type":"INVALID_CREDENTIALS"}

Thank you



--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/

Re: Correct Syntax for Curl

Posted by Nick Couchman <vn...@apache.org>.
On Thu, Mar 14, 2019 at 18:57 sciUser <sh...@securitycentric.net> wrote:

> Anyone know the correct syntax for curl syntax to generate a token for a
> user?


https://davidwalsh.name/curl-post-file

curl -X POST -F 'username=guacuser' -F 'password=password'
https://example.com/guacamole/api/tokens

(I haven't actually tried it, just a guess at this point.)

-Nick