implementation of authentication