B.C.'s privacy watchdog has ruled the provincial NDP broke the law among its own candidates — and others — during its last leadership race.

Before last April's vote for a new leader, the NDP asked potential candidates to hand over their social media passwords as part of the vetting process.

Most of those in the running for the party’s top job agreed to having their Facebook accounts searched. But one candidate — MLA Nicholas Simons — refused.  

He later agreed to hand over personal information without divulging his passwords.

Privacy commissioner Elizabeth Denham ruled Wednesday that the B.C. New Democrats violated the Privacy Act by collecting too much personal information.

Denham said that not only did the party amass details about the candidates, it collected information about other people without their consent.

The privacy commissioner has now issued new guidelines around social media background checks and the NDP says it will have no problem abiding by them.

"As you know we reviewed but we didn't retain any information from candidates’ social media accounts," said the party’s NDP provincial secretary, Jan O'Brien. "And once the privacy  commissioner brought her concerns to us, we stopped collecting social media passwords from candidates."

O'Brien said the NDP will continue working candidates to ensure they're held to a high standard.

With files from the CBC's Jeff Davies