Starting to flesh out some authentication code