LONDON — Young Britons may not often struggle to be served a beer or a glass of wine, but soon they will need a “porn pass” or must otherwise prove that they are at least 18 to watch pornography online.

British lawmakers, concerned that teenagers faced few impediments accessing pornography on the internet, approved a bill last year designed to prevent those under 18 from viewing X-rated sites.

So beginning on July 15, anyone who wants to watch an online porn site will have to submit official forms of identification, including passports, drivers licenses or credit card information, to demonstrate that they are at least 18.

They will also be able to go to designated shops to obtain what has already been dubbed a “porn pass.”