The Trump administration may require foreigners wanting to visit the US to hand over contacts on their cellphones and social media passwords and answer questions about their ideology as part of ​the president’s promised ​extreme vettin​g​, according to a report Tuesday.

Administration officials reviewing the vetting policies also said they want visa applicants to undergo more security reviews and require embassies ​to ​spend more time interviewing the applicants, the Wall Street Journal reported (paywall).

The procedures would also be expanded to include foreigners trying to enter the US from allies like Britain, Germany and France.

“If there is any doubt about a person’s intentions coming to the United States, they should have to overcome​ — ​really and truly prove to our satisfaction​ — ​that they are coming for legitimate reasons,” Gene Hamilton, senior counselor to ​Department of ​Homeland Security Secretary John Kelly​, told the publication​.

President Trump’s revised executive order issued last month barring travel from six mainly Muslim countries called for the policy review, as well as directing security officials to execute a vetting program that allows for a “rigorous evaluation” of applicants to determine if they support terrorism, the report said.

​Trump administration officials said the ​strict rules are needed to keep terrorists from entering the United States.

​A federal judge in Hawaii halted the travel ban March 15, but the review portion of the order was allowed to continue.

​The cellphones of foreign ​visitors usually are examined as they try to enter the country, but that doesn’t usually occur during the application process.

A senior Homeland Security official told the newspaper that the aim is to “figure out who you are communicating with. What you can get on the average person’s phone can be invaluable.”

One of the more controversial aspects of the proposed vetting procedure would be the “ideological test” — although it was used during the Cold War to screen anarchists and members of the Communist Party.

The official said questions under consideration would include whether applicants believe in honor killings, their views on the treatment of women and whom they see as legitimate targets in military attacks.

Civil rights groups have criticized the proposed changes.

“Our views and beliefs and opinions are protected,” Hugh Handeyside, an attorney with the American Civil Liberties Union’s National Security project, told the Wall Street Journal. “Those same principles should drive our decisions about whether people would be permitted to visit the United States.”