<p>Providing quality service to users of the internet of things (IoT) entails addressing two crucial aspects: one related to security and the other concerning the limited resources of IoT devices. We will face a challenge while using timesensitive applications within a network that utilizes a high-performance Wi-Fi technology with exceeding energy consumption. Due to this research challenge, we propose a new algorithm, IoT-quality of service (QoS), designed to achieve a true balance between enhancing the security aspects of IoT devices and improving network-hardware performance. Thus, the algorithm efficiently manages the limited energy resources by monitoring energy levels, communication quality, and queuing delay at access points. This is accomplished by utilizing a streamlined identity management system capable of achieving authentication and access authorization with reduced loading for IoT devices. The research hypothesis underwent validation through a comparative analysis of its performance against the conventional model of a Wi-Fi-based IoT device. This evaluation was conducted utilizing the NS3 simulator and was based on a predetermined set of parameters influencing the examined performance metrics, including power consumption, throughput, delay, and response time. The findings exposed the superiority of the proposed algorithm.</p>