moved authenticiation implementation to python