public UserContext getUserContext(org.apache.guacamole.net.auth.AuthenticatedUser authenticatedUser)
            throws GuacamoleException {

        // The JSONAuthenticationProvider only provides data for users it has
        // authenticated itself
        if (!(authenticatedUser instanceof AuthenticatedUser))
            return null;

        // Return UserContext containing data from the authenticated user's
        // associated UserData object
        UserContext userContext = userContextProvider.get();
        userContext.init(((AuthenticatedUser) authenticatedUser).getUserData());
        return userContext;

    }
Returns a UserContext object initialized with data accessible to the
given AuthenticatedUser.

@param authenticatedUser
    The AuthenticatedUser to retrieve data for.

@return
    A UserContext object initialized with data accessible to the given
    AuthenticatedUser.

@throws GuacamoleException
    If the UserContext cannot be created due to an error.
extensions/guacamole-auth-json/src/main/java/org/apache/guacamole/auth/json/AuthenticationProviderService.java