In view of fast user authentication,the dynamic user authentication protocol is introduced and the possible security risks are pointed out.Then an improvement of the dynamic user authentication protocol is proposed.Finally,the performance of the improved protocol and its application in wireless sensor networks in heterogeneous environment are discussed.