Depends on the reason for the stop
new-south-wales
A car may be lawfully stopped under the Road Traffic Act for various reasons, including that the driver committed a traffic offence, the vehicle appears defective, or for the purpose of administering a random drug or alcohol test. In those cases, the passengers are under no obligation to identify themselves; the driver can be asked to and also asked to produce their driver’s license.
More generally, the law governing this is the Law Enforcement (Powers and Responsibility) Act (LEPRA) 2002, and it consolidated police common law police powers to stop, require identification, and search.
Focusing only on the rules specific to motor vehicles (because there are general situations when you can be asked to identify yourself), police can ask for identification from:
- Passengers when they have a “a reasonable suspicion that a vehicle was or is being used in connection with an indictable offence”.
- “a ‘responsible person, or the person having custody of the vehicle’ to disclose the name and address of a driver where it is alleged that a person has used that vehicle during a traffic offence.”