Maryland employers are no longer allowed to ask workers and job applicants for personal passwords to social media sites like Facebook. (Justin Sullivan/Getty Images)

Maryland is the first state to pass such a law; similar measures are pending in California, Illinois and Michigan.

SB 433 (HB 964) doesn’t mention social media platforms by name, but the issue surfaced last year after Robert Collins, a former officer with the state’s Department of Public Safety and Correctional Services, complained about being asked to provide his Facebook log in information during a recertification interview. The department in 2010 began asking prospective employees for user names and passwords to Facebook accounts as part of a background check to screen employees for gang affiliations, but suspended the practice after the American Civil Liberties Union of Maryland filed a complaint on Collins’s behalf, claiming the practice violated his personal privacy.

A second bill, SB 434 (HB 746), that would have outlawed universities from requiring students and college applicants to disclose user names and passwords for personal electronic accounts passed in the Senate but died in the House. The bill came on the heels of a growing number of universities hiring third-party vendors to monitor student athletes’ Tweets and Facebook posts by having students install social media monitoring software onto personal electronic devices.

Brad Shear, a Bethesda attorney who worked with Sen. Ronald Young’s office on both bills, said banning employers from collecting password-protected information is a win for both employees and companies.

“It not only protects employees’ privacy, it also protects employers,” said Shear, who in 2010 helped draft Maryland’s election laws regulating candidates’ use of social media pages. “It protects [employers] from having to create new legal duties and liabilities and compliance costs.”

The legislation now heads to Gov. Martin O’Malley (D).