'Populate roles based on (groups, project/domain) pair.
We must populate roles from (groups, project/domain) as ephemeral users
don\'t exist in the backend. Upon success, a ``roles`` key will be added
to ``token_dict``.
:param token_dict: dictionary with data used for building token
:param federated_dict: federated information such as identity provider
protocol and set of group IDs
:param user_id: user ID
:param project_id: project ID the token is being scoped to
:param domain_id: domain ID the token is being scoped to'

def _rebuild_federated_token_roles(self, token_dict, federated_dict, user_id, project_id, domain_id):

    group_ids = [x['id'] for x in federated_dict['group_ids']]
    self.v3_token_data_helper.populate_roles_for_federated_user(token_dict, group_ids, project_id, domain_id, user_id)
