A smart city is a concept that leverages technology to improve the quality of life for citizens, enhance sustainability, and streamline urban services. The goal of a smart city is to use data and technology to manage resources and assets efficiently, make informed decisions, and create a more livable and thriving city for its residents. Smart cities rely on a range of technologies including the Internet of Things (IoT), Artificial Intelligence (AI), big data analytics, and cloud computing to gather, process, and analyze data from various sources. The aim is to create a city that is more connected, responsive, and sustainable, and that provides its residents with a better quality of life, opportunities, and services. A secure and efficient message communication protocol for sensitive information and real-time communication is critical for the functioning of a smart city environment. The main findings of this paper are to develop a new authentication protocol that meets the specific requirements and constraints of smart city applications. The message communication between smart cities is conducted with the help of a gateway. The challenge in constructing a working, viable infrastructure for a smart city is to provide secure authentication for message communication between the user and gateway node in one network, and the gateway node of one network to the gateway node of the other network. The objective for doing research to develop an authentication protocol that ensures the privacy and security of data transmitted in smart city applications while maintaining a lightweight and efficient design. This paper proposes a secure authentication protocol and key establishment scheme for access to the application in smart cities to make feasible access through the IoT environment. The proposed protocol ensures the mutual authentication between user and gateways, and the security analysis shows that the proposed protocol is effective against energy consumption and have less computational cost. The performance of the proposed method is analyzed and tested using BAN Logic and AVISPA security verification to confirm the authenticity of the security protocol. We do compare with past studies of which our proposed method outperformed.