AB1844 passed 69-0 and now moves to the California Senate. The bill would ban employers from requiring current or prospective employees to disclose usernames or passwords for sites such as Facebook and Twitter.
Supporters of the bill say some employers use social media to obtain answers to questions they cannot legally ask on job applications.
Democratic Assemblywoman Nora Campos of San Jose, the bill's author, says there are too few social media privacy laws to protect employees.
The Associated Press contributed to this report.