Collins, who no longer works for the Department of Corrections and is pursuing a degree in nursing, said he has talked to other people who have also been required to hand over their account information, but "they didn't think anything of it."
While the Maryland legislation is the first of its kind, lawmakers in at least seven other states have introduced legislation to limit employer access to social media user names and passwords, according to the National Conference of State Legislatures.
It is unclear if the measure will become law because Democratic Gov. Martin O'Malley is still reviewing which legislation he will sign, a spokeswoman for the governor's office said.
A companion bill that would have kept colleges and universities from requiring that students disclose account information passed the Maryland Senate, but saw no movement in the House of Delegates.
Democratic U.S. Sens. Chuck Schumer of New York and Richard Blumenthal of Connecticut have also asked Attorney General Eric Holder to investigate whether asking for log-in information during job interviews violates federal law.
Allie Bohm, an advocacy and policy strategist for the ACLU, says the practice of asking to surf someone's social media profile is akin to asking for the key to their house and going through their mail.
"We don't want to create a situation where employers think it's appropriate just because it's online," Bohm said.
Shear, who pushed for the Maryland legislation, said giving employers access to password-protected information not only violates people's privacy, but hampers technology development, which relies on users to trust the security of the websites.
"There's a whole generation of future leaders where they're going to be our elected leaders, our judges, our lawyers, our business people," Shear said. "Do we really want all those people to think it's OK for the government to see our private content without any warrant or subpoena or anything like that?"
Facebook director for state public policy Will Castleberry applauded the bill.
"Asking employees or job applicants for their passwords is wrong," he said in a statement.
Business representatives, including the Maryland Chamber of Commerce, argue that the bill is bad for business and that requests for log information are very rare.
While media have reported a few handful of instances around the country of employers asking for passwords, using third-party software to spy on profiles and requesting that applicants "friend" managers in order to vet their accounts, the practice is not widespread, said Elizabeth Torphy-Donzella, a labor and employment attorney with Baltimore-based Shawe Rosenthal LLP.
"I do not have one client that to my knowledge asked someone for their Facebook page and most of my clients would not even think of that," she said.
Torphy-Donzella, who worked with the Maryland Chamber of Commerce to oppose the bill, said it takes away important access for employers who need to investigate harassment claims and other misconduct.
"It was drafted in a manner that didn't take account of legitimate employer needs to request access to employee Facebook pages," she said.
But Shear argues that the legislation is good for businesses because it prevents them from being liable for information, such as criminal or harassing behavior, that they could discover when reviewing employee profiles.
"There's no good reason to do this," Shear said. "If you're in HR and you're doing it, you're creating tremendous legal liability for your company."
email: tech@cnbc.com