You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@guacamole.apache.org by Dennis Hoffmann <de...@googlemail.com> on 2019/02/18 13:48:11 UTC

Add an extra button to the Authentication Page

Hi,

i want to add an extra button to the Custom Authentication Page.
If a user clicks on that button i want to catch this event in my extension
and execute some code.
Should I add this button to my HTML-templatefile? If the answer is yes :
how can i catch this event in my code?

Thanks in advance

Re: Add an extra button to the Authentication Page

Posted by Nick Couchman <vn...@apache.org>.
On Mon, Feb 18, 2019 at 8:48 AM Dennis Hoffmann <de...@googlemail.com>
wrote:

> Hi,
>
> i want to add an extra button to the Custom Authentication Page.
> If a user clicks on that button i want to catch this event in my extension
> and execute some code.
> Should I add this button to my HTML-templatefile? If the answer is yes :
> how can i catch this event in my code?
>
>
For adding a button, I'd suggest you make this part of your extension and
just add the HTML and AngularJS code into your extension.  You can update
the existing HTML using the <meta> tags, as documented here:

http://guacamole.apache.org/doc/gug/guacamole-ext.html#ext-patch-html

You'll need to implement both the HTML template and also the AngularJS code
to fire off something to your extension when the new button is clicked.
Depending on how the extension is written, you could have your extension
listen on a REST endpoint:

http://guacamole.apache.org/doc/gug/guacamole-ext.html#ext-rest-resources

This is implemented by overriding the getResource() method in either the
AuthenticationProvider implementing class or in the UserContext
implementation, and having that return an object that implements the
required REST handlers for talking to the AngularJS app.  You could then
call these REST endpoints from the AngularJS code.

-Nick