Working in secrecy, Mr. Johnson’s team huddled for hours each day under orders to use “our legal authorities to the fullest extent” on a new deportations policy, a senior administration official said. In five White House meetings over the summer, Mr. Johnson and Mr. Obama, both lawyers, pored over proposed changes together, eventually concluding that the president had the authority to enact changes that could affect millions of people and significantly alter the way immigration laws are enforced.

Mr. Johnson’s review of the president’s legal authority was supposed to help resolve the issue. But his first attempt in May was rejected, White House officials said, because in the president’s view, he did not go far enough. The effort only sought to sharpen the guidance for immigration agents, but did not provide work permits or directly shield anyone from deportation.

And yet, with Republicans still struggling to move forward, the president’s Democratic allies on Capitol Hill reminded him that even Mr. Johnson’s modest proposals would probably derail any hopes for legislation.

Mr. Obama told Mr. Johnson to keep working.