In particular, this is already done using a digital ID for foreign residents (at least on most visas) in the UK, which was phased in over the past few years.