General purpose authentication module