The code below will give me the token I need to access a sharing link. It comes from a tunnel/client connection I created - ie I create a tunnel object, pass it into the client then connect. The tunnel object then has a UUID that I need to call the two API end points to get the actual sharing ‘token’ which I then append to the https://10.0.0.9:8443/guacamole/#/?key= url - this appears to be a valid sharing link.
this.http.get<object>(` https://10.0.0.9:8443/guacamole/api/session/tunnels/${this.tunnel.uuid}/activeConnection/connection/sharingProfiles?token=${this.guacamoleService.authToken}`).subscribe(result => { var item = result["1”]; console.log(item.identifier) this.http.get<object>(` https://10.0.0.9:8443/guacamole/api/session/tunnels/${this.tunnel.uuid}/activeConnection/sharingCredentials/${item.identifier}?token=${this.guacamoleService.authToken}`).subscribe(result => { console.log(result) var item = result["values”]; this.sharingID = item.key; console.log(item.key) this.userService.setUserSharingToken(4, item.key).subscribe(result => { this.userService.getUserSharingToken(4).subscribe(result => { console.log("URI Token " + result.token) }) }); }) This all works like a charm - it’s just that this route won’t allow me to use the default Guacamole Client. Which does work with something like this to add It to y angular view this.guacView.nativeElement.replaceChildren(this.client.getDisplay().getElement()) The ‘problem’ is it doesn’t actually handle anything - keyboard/mouse etc without me adding extra code - more or less recreating the guacamole client….. If I could just get that sharing link all would be good. On June 17, 2023 at 7:51:02 PM, Nick Couchman ([email protected]) wrote: On Sat, Jun 17, 2023 at 9:24 PM Greg Lose <[email protected]> wrote: > > I am use the mysql authentication > > > On June 17, 2023 at 7:23:53 PM, Greg Lose ([email protected]) wrote: > > Ultimately what I am trying to get at is the sharing link. I have it > working by rolling my own client+ api work and everything works great > except, of course, I have to build my own client. Since Guacamole, out of > the box works exactly as I need it to all I really need is that darn link, > I though ok, maybe I can use the API to see info about a specific user and > just work backwards from that but the inability to get a list of tunnels > for a user blocks me as far as I can tell. So I'm guessing your goal in programmatically getting the sharing link is to be able to join the existing active connection, or provide that link to others who may want to join that connection? I think there are a couple of things to keep in mind with regard to that: * Joining an existing connection - either via the sharing link or some other means - is different from joining an existing tunnel. A connection contains a tunnel, but it is not identical to a tunnel. A tunnel should essentially be a point-to-point link between a browser and the Java application server, which then carries it on to guacd. When you join an existing connection, you create a new tunnel that is then associated with the open connection - you do not join the existing tunnel. This is why you actually don't need to get a list of tunnels from Guacamole API, because the tunnels are supposed to be isolated to a single connection for a single session for a particular user. * The Sharing Link is actually a form of authentication - it essentially sets up a token, much as you would obtain by entering a username and password, that has access to one and only one connection (the one being shared). If your goal is to allow people to join an existing connection without having to authenticate to Guacamole, then the Sharing Link is probably what you're actually after. * That said, the sharing token (link) does not actually get generated until the person who "owns" the connection actually goes to the Sharing menu and selects the option to share the connection, so it isn't automatically available as soon as a connection is started. * If you want other users to be able to join an existing connection without the user having to share it, then there are probably other ways to accomplish this, they just may require a little extra code to get working. Admins are able to see existing connections and join them; however, there's no way built-in to the GUI to grant other users access to join an existing connection. The permissions may be there, already, but it isn't something I've tried, and may require some extending of the client in order to ease the process of providing that. Hopefully that helps - and Mike or James may be able to jump in and provide some more pointers. -Nick
