get_user_identity is splitted to two methods to allow redefine a query