Modularized authentication