Failure to comply with commands given by an officer. Suspicious activity. Belligerent conduct. Whether these are actual charges or not don't even matter, as officers aren't legally required (by supreme court decision) to understand the law they enforce. If they want to arrest you they can.
So to restate your question: On what basis do the police think they can arrest you?
It is not the case that you can be lawfully arrested simply for failing to comply with any given command given by an officer. See, for instance, the last 10 years of case law regarding people recording the police despite their urgent demands that they stop.
It's fair to point out that the police can arrest you unlawfully, and that's a real risk you run when saying "no" to them. But it's important to know that saying "no" to a request for your Twitter account name is legally very safe, and that the police would be way out over their skis arresting you for doing that.
Being detained for questioning is not a big deal, but being arrested is a very big deal, and it does not happen as casually as message boards think it does. If the police routinely arrest people without lawful cause, there are consequences (though they aren't the consequences any of us would hope there'd be).
Are there consequences to them for detaining you for no good reason? Because that seems to me to be their best strategy if someone refuses to give them their social media accounts. Make it kind of costly, but not to the point where the officer involved gets in any trouble.
There are more- and less- formal restrictions on how long they can detain you, but my mental model is just that they can detain you for basically any reason --- it is not my claim that there are magic words that can get the police to go away, or to stop asking you questions, and you might just have to put up with it until they get tired of you.
The next step, though, where they trundle you off to a police station for interrogation --- that's an arrest. It's a big deal. Actual cause is needed.
You've made good points on this. My concern would be that police officers have an obligation to gather this information as it states in the article, and that they would lean on their powers to detain and arrest in order to coerce that information.
Let's run through a hypothetical. Routine traffic stop. Cop pulls out one of these cards and asks for your handles. You refuse, claim Miranda rights, or something similar. Cop says you, "match the description of a known suspect" (in a city as large as LA everyone matches a known suspect) and this is part of the ID process. "Of course, we can do a check using the computers at the station but you'll need to come with us until we confirm your ID ..."
Now, following through on that threat is an arrest, but under California law police have 48-hours to investigate before either charging you with a crime or releasing you. I doubt most officers would use the entire time, but letting someone stew for the afternoon in a drunk tank seems entirely within reason. During that time their car has been impounded and they're either missing work or missing time with their loved ones. Refusing to self identify could carry an effective fine in the hundreds of dollars, and that worries me.
I don't think it's plausible that the police will routinely rely on arrests to get social media information from random stops, for a bunch of reasons; part of it is that it's unlawful for them to do so, but the bigger part of it is that it's incredibly inefficient and painful for them to do that too.
If the argument is that the police will use this as a pretext to arrest people they want to arrest anyways, well, it's a dumb pretext. They have dozens of pretexts that aren't overtly unlawful; the idea that they're going to haul people in for an offense that they won't be able to articulate when they process you at the station (because it is not in fact a violation of any California statute) seems, to me, far-fetched.
It is problematic that they ask this question. I'm not lobbying for its inclusion. It's bad because people will, as has been pointed out all over the thread (including by my top comment) believe they have to answer. But the response to that problem should be to educate people not to answer the question, not to accept the victimizing framework of the article.
The police, by the way, cannot hold you for 48 hours while looking for something to charge you with. To arrest you, they need probable cause of a specific crime, which they'll need to provide when they book you. They can then charge you with other stuff they dream up while they hold you, but they need something to start with. Again: refusing to answer this question isn't "Obstruction of justice" (which isn't a California offense in the first place); the California "resisting" statutes generally require force or violence on your part, or your interference with their questioning of someone else.
So to restate your question: On what basis do the police think they can arrest you?