A Trust Management Approach for Sybil Attack Detection in Wireless Sensor Networks