The British Airline Pilots Association (Balpa), which represents 10,000 of the 12,000 commercial pilots and flight engineers in Britain, said its members were being treated as "guinea pigs".
"The government's early warning system should be flashing over opposition to the plans," Balpa's General Secretary Jim McAuslan said.
According to the Home Office, the identity cards will help airport workers improve security and streamline pass applications when staff move jobs and the first trial is scheduled for staff Manchester airport and London City airport.
The staff will be required to sign up for an identity card before they can get security passes allowing them to work there and if the regulations are approved, the first cards will be issued at the two airports from autumn next year as part of an 18-month trial.
McAuslan said he would be consulting members on the possibility of industrial action if the government pressed ahead with the plans.
"It may come to an industrial dispute. We would want to avoid that. We would want the government to think again about the compulsory nature of it and think again about the whole scheme," he said.
He added that the government had said previously that ID cards will be voluntary but the indications are that if you choose not to have a card you will not get an airside pass.