They are allowed to do it, just tell them that you will only CONSIDER doing it if they put it in writing, in Japan you **always** have a right to refuse it (but this may mean you get thrown out of your flight)
If they insist ask for the badge number of the officer and later submit a formal complaint