Creating authentication handler, some changes in login action and in groups