On Tue, Apr 18, 2023, 6:23 PM Gabriel Huerta Araujo
<[email protected]> wrote:

> ...
>
> It was like this
>
>     @Override
>
>     public UserContext getUserContext(AuthenticatedUser authenticatedUser)
>
>             throws GuacamoleException {
>
>         // No associated data whatsoever
>
>        return null;
>
>     }
>

This is correct for an extension that provides no data of its own.

With below modification, It works like a charm now.
>
>     @Override
>
>     public UserContext getUserContext(AuthenticatedUser authenticatedUser)
>
>             throws GuacamoleException {
>
>         // No associated data whatsoever
>
>        return
> authenticatedUser.getAuthenticationProvider().getUserContext(authenticatedUser);
>
>     }
>

Sorry, but the above is very incorrect. You are essentially performing the
same call to getUserContext() that Guacamole itself would make, returning a
second copy of a UserContext from a different AuthenticationProvider as if
it came from this one. This may cause really odd behavior or break in
unexpected ways.

What you had before was correct.

- Mike

Reply via email to