Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate token API throws 404 error #14

Open
plrnr opened this issue Jan 20, 2023 · 2 comments
Open

Generate token API throws 404 error #14

plrnr opened this issue Jan 20, 2023 · 2 comments

Comments

@plrnr
Copy link

plrnr commented Jan 20, 2023

Hi,

Guacamole 1.4.0 version.
I am using python requests to make API call to generate token which I plan to use to make other API calls.

>>> import requests
>>> payload = {'username': 'guacadmin', 'contentType': 'application/x-www-form-urlencoded', 'password': 'guacadmin', 'Content-type': 'application/x-www-form-urlencoded'}
url = 'http://127.0.0.1:8080/api/tokens'
>>> response = requests.post(url,data=payload)
>>> print(response.text)
<!doctype html><html lang="en"><head><title>HTTP Status 404 – Not Found</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 404 – Not Found</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Description</b> The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.</p><hr class="line" /><h3>Apache Tomcat/8.5.73</h3></body></html>
>>> response.ok
False
>>> response.status_code
404

Any help is appreciated.

Thanks

@brolifen
Copy link

brolifen commented Jun 3, 2023

Have the same problem, did you manage to fix it?

image

@brolifen
Copy link

brolifen commented Jun 3, 2023

I shortly after discovered this is because the path should be api/tokens and not guacamole/api/tokens as the example page shows. Additionaly in form encode you have use = and not : which is for json encoding

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants