I would probably use something existing and well established like OpenLDAP. I think it uses e-mail, but I have only used it for sites that host their own e-mail servers so IDK.
My bookshelf: https://www.goodreads.com/review/list/152760030
Comics: https://leagueofcomicgeeks.com/profile/dikitain