Mr. Trump did not allow Ms. Gordon to deliver a recent intelligence briefing, according to a person familiar with the matter. Opposition in the White House to letting her serve as acting director has raised the question of whether she will be ousted as part of a leadership shuffle at the intelligence director’s office that will be more to Mr. Trump’s liking.

A federal statute says that if the position of director of national intelligence becomes vacant, the deputy director — currently Ms. Gordon — shall serve as acting director.

But there appears to be a loophole: The law gives the White House much more flexibility in choosing who to appoint as the acting deputy if the No. 2 position is vacant, said Robert M. Chesney, a law professor at the University of Texas at Austin, who specializes in national-security legal issues.

Ms. Gordon will retire if told by the White House that Mr. Trump wants someone else in the deputy’s role who could then rise to fill the vacancy created when Mr. Coats departs, according to officials.