IANAL, but actually I think that you would be correct. Most of you I'm sure recall from not too long back that it is illegal to violate a website's Terms of Service - http://www.securityfocus.com/news/11519
. I haven't checked, but it is a good bet that the Terms of Service for Myspace, Facebook, etc., forbid you from giving out your password to anybody. Additionally, were the city to recieve the username and password and then use those to log into your account, they would (within the spirit of the law even) be violating the same law.
This line of thought also raises the interesting possibility of using arbitrary terms of services to shield ones self from compulsory searches, such as drug screenings at work. You're asked to pee in a cup and reply "I'm sorry, but I just signed up for website X, and it forbids me from taking a drug screening when no probable use of illicit substances is shown. Violating the terms of service would be illegal."
"Sorry you're fired."
"oh really? You're firing me for refusing to break the law? I'm pretty sure that is grounds for a lawsuit, so the question is, do you want to pay my salary in exchange for me doing work for you, or after an expensive lawsuit?"
(Note, you wouldn't be able to agree to the terms of service if an existing employee agreement already requires you to submit to random drug tests, so don't be stupid. Also, again, IANAL, so don't blame me if you get fired/don't get a job.)