In order to solve the problem that multi-authority attribute-based encryption (ABE) is vulnerable to collusion attack, firstly, user behaviours of making request for key were formulized into legality and collusion according to the relationship between user’s attribute and decryption threshold. Furthermore, a free Global ID (GID) ABE algorithm was proposed, where each attribute authority is required to run a security check for users’requests with the help of a trusted central authority, so that only legal user has power to decrypt message instead of colluders. The results of security analysis and performance evaluation showed that the proposed algorithm not only improves user’s privacy, but also doesn’t evidently increase communication overhead incurred by the node and the delay of transmitting node in wireless sensor networks (WSNs), and it is suitable for WSNs.