Indonesian police and army officials have been accused of using the abusive two-finger test to check whether female recruits are virgins.
The test allows doctors to inspect the hymen of recruits to check whether it is still intact.
Human Rights Watch (HRW) has called on Indonesian President Joko "Jokowi" Widodo to ban the "cruel and discriminatory tests", which the World Health Organisation declared to be unscientific in 2014.
"These tests are degrading and discriminatory and they harm women's equal access to important job opportunities," HRW women's rights advocacy director Nisha Varia said.
"The Indonesian government's continuing tolerance for abusive 'virginity tests' by the security forces reflects an appalling lack of political will to protect the rights of Indonesian women," she added.
One military doctor told HRW that he and his colleagues were aware of the arguments against two-finger testing, but said that the practice would continue until it was banned by army commander General Gatot Nurmantyo.
"The military is a top-down organisation. We have to follow orders," he said.
In 2015, the then-commander of the army, General Moeldoko, responded to criticism about the testing with the comment: "So what's the problem? It's a good thing, so why criticise it?"
Indonesian military spokesperson Fuad Basya said that virginity tests are used to expel "naughty" recruits from the army. "If they are no longer virgins, if they are naughty, it means their mentality is not good," he said.
Police spokesman Setyo Wasisto said that the force had not used the test for three years and that medical examinations of female recruits were always carried out by female doctors.
The two-finger test is also used in India on alleged rape victims, despite a ban on the controversial practice being introduced in 2014. This month, 23-year-old Kajal told HRW how she was subjected to the humiliating test after she was gang-raped by three men in 2015.