On Thu, Jan 9, 2020 at 1:28 PM Vieri <[email protected]> wrote:
> On Thursday, January 9, 2020, 7:42:44 PM GMT+1, Nick Couchman < > [email protected]> wrote: > > > >This manual page describes the process of adding an extension, including > modifying HTML: > > http://guacamole.apache.org/doc/gug/guacamole-ext.html > > Yes, modifying static HTML is fine. > However, I read that page where it says: > "Extensions to Guacamole can: > Provide alternative authentication methods and sources of connection/user > data." > > I was wondering how to provide "connection data" ie. new HTTP URL objects > at log-in time (so that different users can see different sets of URL > links). What you're looking for in this isn't a way to provide connection data, which is a very specific thing and not a generic way to link to arbitrary URLs, but a means of exposing arbitrary data from within your extension. You can do this by exposing a REST service. For the data to be user-specific, you would expose this REST service at the UserContext level: http://guacamole.apache.org/doc/guacamole-ext/org/apache/guacamole/net/auth/UserContext.html#getResource-- See: http://guacamole.apache.org/doc/gug/guacamole-ext.html#ext-rest-resources You can then read from that resource using JavaScript and generate content within the home screen. The best way to do that would probably be to use your extension to add an AngularJS directive which renders the content you're looking for, and then leverage the HTML patching system you're already using to add HTML which refers to your directive. The manual doesn't give a simple example, so I guess it must be tricky. Is > the authentication provider rersponsible for creating/passing along these > objects? Connection data is exposed by the UserContext which is exposed by the AuthenticationProvider, yes. It is also possible for AuthenticationProviders to decorate the UserContext objects returned by other AuthenticationProviders, augmenting their functionality. That said, I don't believe this is what you should use here. Connection data is data for Guacamole connections, not arbitrary links or URLs. In other words, if I use the LDAP authentication provider, should I look > into its code alone to see if I can generate my HTTP URLs? Or should this > be done on the core guacamole-client code? I would recommend exposing a custom REST service which lists the desired URLs and leveraging an AngularJS directive to retrieve and render those URLs within the Guacamole home page, as described above. - Mike
