I tried the way you said, but I'm not sure if there is a bug in my json format for submitting data, or anything else,I get an error XMLHttpRequest can not load http://10.128.0.211:8080/guacamole/api/tokens. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed.
发件人: Nick Couchman [mailto:[email protected]] 发送时间: 当前系统时间为:2018年2月3日 12:09 收件人: [email protected] 主题: Re: Login to guacamole using the web api On Fri, Feb 2, 2018 at 10:55 PM, zhangbin <[email protected] <mailto:[email protected]> > wrote: Hello, how do I use guacamole/api/tokens and login remotely to guacamole web api by submitting username, password json format data to get the authentication code... The easiest way to figure out what you need is to use something like Chrome Developer Tools, the Network tab, specifically, and watch the login process. Basically it looks sometihng like this: - You load the page, which posts to the tokens endpoint on the API and receives a 403 INSUFFICIENT CREDENTIALS error. - The AngularJS web application interprets this and presents the username/password dialog - You type your username and password, and submit - This POSTs a application/x-www-form-urlencoded back to the token endpoint, with the username and password as form parameters. - In response, assuming successful authentication, you receive the authToken back in the response, which you can then use as the token parameter in subsequent API calls. so that direct calls to the remote desktop window can be made. What kind of "direct calls" are you talking about, here? Logging into the API like this allows you to interact with the API using the token, but I'm not sure about making direct calls to a remote desktop window. You can certainly use this method to establish a tunnel to a given connection, but if you're thinking you can authenticate to the API and then somehow send and receive data from a remote desktop session, this is not how it works - at least, not quite that easily. -Nick
