I'm trying to move users from ArcGIS online logins to SSO logins, and one thing I stuck on is favorites. I can get the list of favorites from the old user using the favGroupId but when I try hen I try to add them to the new user by sharing them to the favGroupId (the way I would with any other group), I just get 'notSharedWith' for all the items.
favs = gis.groups.get(olduser.favGroupId)
for fav in favs.content():
print(fav.share(groups=newuser.favGroupId))
# Full item and group IDs edited out
{'notSharedWith': ['94..aa'], 'itemId': 'b4..34'}
{'notSharedWith': ['94..aa'], 'itemId': 'a5..77'}
{'notSharedWith': ['94..aa'], 'itemId': '64..35'}
Is there another way to do this?
It turns out the above code works fine as long as I'm logged in to the gis as the newuser, however that doesn't work for me in this scenario because I can't log in as the target SSO users.
It does not work if I'm just logged in as an admin (which is what I tried above).
I'm still looking for another option.
Hi @SeanSweeney, I'm in a similar situation 3.5 years later. Did you figure this one out?
Hi @TristanMcHardie,
Sadly, I never did figure this one out. I ended up just sending each user a list of their favorites to re-add themselves, which was painful for everyone.
Since this was a one-time thing for us, I never went back to see if anything was ever added to the API for this.
I'm sorry I can't be more help and I hope you can find a better solution.
Regards,
Sean Sweeney
Thanks for replying so quickly! Yes, that's what I've ended up doing as well - sending an email with a list of items. As you say, a one-time thing, so not worth delving further into.
Thanks again,
Tristan