integrated authentication into basic server code