Setting up login mechanism