@Override
    public UserContext decorate(UserContext context,
            AuthenticatedUser authenticatedUser, Credentials credentials)
            throws GuacamoleException {

        String remoteAddress = credentials.getRemoteAddress();
        
        // Verify identity of user
        RestrictionVerificationService.verifyLoginRestrictions(context,
                authenticatedUser.getEffectiveUserGroups(), remoteAddress);

        // User has been verified, and authentication should be allowed to
        // continue
        return new RestrictedUserContext(context, remoteAddress,
                authenticatedUser.getEffectiveUserGroups());

    }
AuthenticationProvider implementation which provides additional restrictions
for users, groups of users, connections, and connection groups, allowing
administrators to further control access to Guacamole resources.
extensions/guacamole-auth-restrict/src/main/java/org/apache/guacamole/auth/restrict/RestrictionAuthenticationProvider.java