WASHINGTON - The controversy over the government's secret subpoena of Associated Press telephone records has revived legislation that protect journalists from having to reveal their sources to federal investigators - and the White House is endorsing the idea.

The proposal wouldn't provide blanket protection for a journalist from having to reveal who he or she spoke to confidentially. But the government would have to convince a federal judge that the confidential source had compromised national security in speaking to the journalist.

Sen. Chuck Schumer, D-N.Y., said he and Sen. Lindsey Graham, R-S.C., will reintroduce the so-called media-shield bill pursued unsuccessfully four years ago.

President Obama said Thursday that the point of a media-shield law was to strike the right balance between national security needs and a free press that "helps our democracy function."

"I think now's the time for us to go ahead and revisit that legislation," Obama said. "I think that's a worthy conversation to have, and I think that's important."

Back in 2009, after the House passed a media-shield bill, the action shifted to the Senate, where the Obama administration lobbied to add provisions aimed at protecting national security. That led to a compromise bill that would protect reporters' sources, but grant the government authority to override that in certain national security cases.

Despite those concessions, the bill garnered the support of the American Society of Newspaper Editors.

In the AP case, the Justice Department secretly obtained telephone records of the news organization's reporters and editors for more than 20 separate telephone lines in April and May 2012. The AP was not told of the seizure until after the fact, provoking angry responses this week from the company's president and CEO, other news outlets and members of Congress.

The department hasn't said whether it got permission from a judge, but subpoenas are often issued by grand juries at the request of prosecutors.

Had a shield law been in effect, it might have forced the government to at least go through a federal judge to obtain the records.

The department collected the phone records in an attempt to find out sources for a May 7, 2012, AP story that disclosed details of a thwarted plot in Yemen to bomb a U.S.-bound airliner, around the anniversary of the killing of terrorist leader Osama bin Laden.