Authentication business logic.