The legislation, which passed unanimously, gives the Department of Motor Vehicles authority to issue digital credentials and lets residents present identification in an electronic format, such as on a smartphone, instead of a physical credential, except when prohibited by federal law.