refactor thisWtrealm and thisWreply for remote idp feature