Billions of interconnected devices equipped with sensors and communication modules are referred to Internet of things (IoT). Through connecting internet services, the IoT devices become smart terminals which can leverage computing capability of powerful server in the cloud or edge so as to be applied in people daily life. The devices access the service via RESTful APIs and how the server authenticated and authorized billions of devices is important. Token-based authorization is most popular that the devices can have a safer access through the token. Token is usually released by a third-party authentication center to make assurance of its reliability and security. Image encryption is given much attention in the IoT of visual sensors. Therefore, we propose a token-based lightweight image cryptography method that combining the token and simple logic operator to do the secured transmission over the internet. The experimental result shows the method has good effect.