On 5/11/23 19:32, Gabriel Huerta Araujo wrote:
My question is related to when a user enters into Guacamole web application in 
a computer and they should not enter with their same account into another 
computer. I would try to change Guacamole
application, question here is where I would do it? That is why I meant there 
are two places to do the changes: When user log in (to record log in access and 
ask the next time when same user access) and
when user log out (delete record access to make it accesible).  Is there a way 
to make it, using Open-Close principle (close to change, open to extension).

I found out logout function (file authenticationService.js) to go out from 
Guacamole web application. I am not proficient with Angular. Any guide or 
example to execute a REST service (java code) to be executed from js code, and 
this last one receives a response from java code?.


To perform an action when a user logs in, you would implement an extension containing your own AuthentcationProvider that performs whatever tasks you need within getUserContext():

https://guacamole.apache.org/doc/guacamole-ext/org/apache/guacamole/net/auth/AuthenticationProvider.html#getUserContext(org.apache.guacamole.net.auth.AuthenticatedUser)

That function will be called for all installed extensions after authentication has succeeded.

To perform an action when a user logs out, you would make sure your implementation of getUserContext() returns a UserContext of your own that implements invalidate():

https://guacamole.apache.org/doc/guacamole-ext/org/apache/guacamole/net/auth/UserContext.html#invalidate()

That function is called for all UserContexts associated with a user when their session is no longer valid, including when they log out

- Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to