I've found a curious apparent incompatibility between the Python API as installed with Pro 3.0 and Portal 10.8.1. When I try to search or access items, or perform admin tasks, I get permissions errors:
Exception: You do not have permissions to access this resource or perform this operation.
(Error Code: 403)
For items, the only way to resolve this is to share the item publicly, which is not a good solution for the feature layers I'm working with. At first, I thought it might be the machine I was accessing it from, but I saw that it was working with our Dev Portal which is at 10.9.1. So I tested using another machine which still had Pro at 2.9, and it worked correctly. I then upgraded Pro on that machine to 3.0 and saw the same behavior. Is this a bug? Or is there a security setting, additional authentication step, etc, I need to be using?
Here is an example of the code I'm using:
from arcgis import gis
portal = gis.GIS(r'https://myserver.myCompany.com/portal', username = r'superduperuser')
portal.content.get("ebea40d5aeg1beri5h3924306fe3142f")