<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Logged into AGOL via Python API but can't access my items in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/logged-into-agol-via-python-api-but-can-t-access/m-p/716804#M98</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for sharing your experience. I have managed to use gis.content.get to access private items using the username and password of a public account associated with our organization. Not really ideal because almost nobody in our organization authenticates this way. Especially since our org is going all-in on AGOL, it's frustrating to find out that ownership doesn't really mean ownership.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Jul 2018 13:48:16 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2018-07-30T13:48:16Z</dc:date>
    <item>
      <title>Logged into AGOL via Python API but can't access my items</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/logged-into-agol-via-python-api-but-can-t-access/m-p/716802#M96</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When connecting to my organizational AGOL account via the Python API, I have found lately that while the login appears to succeed, I do not have the same level of access to my items that I have when accessing them through the AGOL browser interface or ArcGIS Pro.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Setup&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;OS: Windows 10&lt;/LI&gt;&lt;LI&gt;Python Version: 3.5 on&amp;nbsp;Anaconda. &lt;BR /&gt;NOTE: This is not the an environment from the Anaconda installation that comes with ArcGIS Pro. This is an installation I had prior to installing ArcGIS Pro. (requirements.txt attached)&lt;/LI&gt;&lt;LI&gt;ArcGIS Python API Version: 1.4.2&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, I import my packages:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcgis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;gis &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; IPython&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;display &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; display‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;My organizational account must be authenticated via OAuth 2.0. I have followed the instructions &lt;A href="https://developers.arcgis.com/python/guide/working-with-different-authentication-schemes/#User-authentication-with-OAuth-2.0" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;&amp;nbsp;for authenticating with OAuth 2.0. I have created an application called&amp;nbsp;&lt;STRONG&gt;Python&lt;/STRONG&gt; and used the following code to login.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;gis &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; GIS&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2F" target="_blank"&gt;https://&lt;/A&gt;&lt;SPAN&gt;{{ MY_ORG }}.maps.arcgis.com"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; client_id&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'{{MY_APP_ID}}'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Successfully logged in as: "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;properties&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;user&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;username&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This appears to work with no problem as there are no errors returned and the following statement is printed:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Successfully logged in as: {{ MY USERNAME }}‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However, problems arise when I try to access any of my items. Note, by "my items" I mean those for which I am the item owner. For the sake of example, let's say I try to access an item by its item number:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;item &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;content&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;get&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'{{SOME ITEM ID}}'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
display&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;item&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This throws the following error&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;You do not have permissions to access this resource or perform this operation.

---------------------------------------------------------------------------
RuntimeError&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Traceback (most recent call last)
&amp;lt;ipython-input-3-faf871f03a5b&amp;gt; in &amp;lt;module&amp;gt;()
----&amp;gt; 1 gis.content.get('{{ SOME ITEM ID }}')

~\Miniconda3\envs\arcpython\lib\site-packages\arcgis\gis\__init__.py in get(self, itemid)
&amp;nbsp;&amp;nbsp; 2653&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return None
&amp;nbsp;&amp;nbsp; 2654&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
-&amp;gt; 2655&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise re
&amp;nbsp;&amp;nbsp; 2656 
&amp;nbsp;&amp;nbsp; 2657&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if item is not None:

~\Miniconda3\envs\arcpython\lib\site-packages\arcgis\gis\__init__.py in get(self, itemid)
&amp;nbsp;&amp;nbsp; 2648&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; """
&amp;nbsp;&amp;nbsp; 2649&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
-&amp;gt; 2650&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; item = self._portal.get_item(itemid)
&amp;nbsp;&amp;nbsp; 2651&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; except RuntimeError as re:
&amp;nbsp;&amp;nbsp; 2652&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if re.args[0].__contains__("Item does not exist or is inaccessible"):

~\Miniconda3\envs\arcpython\lib\site-packages\arcgis\_impl\portalpy.py in get_item(self, itemid)
&amp;nbsp;&amp;nbsp; 1206&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ================&amp;nbsp; ========================================================
&amp;nbsp;&amp;nbsp; 1207&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; """
-&amp;gt; 1208&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return self.con.post('content/items/' + itemid, self._postdata())
&amp;nbsp;&amp;nbsp; 1209 
&amp;nbsp;&amp;nbsp; 1210&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; def get_item_data(self, itemid, try_json=True):

~\Miniconda3\envs\arcpython\lib\site-packages\arcgis\_impl\connection.py in post(self, path, postdata, files, ssl, compress, is_retry, use_ordered_dict, add_token, verify_cert, token, try_json, out_folder, file_name, force_bytes, add_headers)
&amp;nbsp;&amp;nbsp; 1154&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; verify_cert=verify_cert, is_retry=True)
&amp;nbsp;&amp;nbsp; 1155 
-&amp;gt; 1156&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self._handle_json_error(resp_json['error'], errorcode)
&amp;nbsp;&amp;nbsp; 1157&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return None
&amp;nbsp;&amp;nbsp; 1158 

~\Miniconda3\envs\arcpython\lib\site-packages\arcgis\_impl\connection.py in _handle_json_error(self, error, errorcode)
&amp;nbsp;&amp;nbsp; 1175 
&amp;nbsp;&amp;nbsp; 1176&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; errormessage = errormessage + "\n(Error Code: " + str(errorcode) +")"
-&amp;gt; 1177&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise RuntimeError(errormessage)
&amp;nbsp;&amp;nbsp; 1178 
&amp;nbsp;&amp;nbsp; 1179 class _StrictURLopener(request.FancyURLopener):

RuntimeError: You do not have permissions to access this resource or perform this operation.
(Error Code: 403)‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tested this process under a few different scenarios and not had these permission errors arise:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;On the same machine as this example, if I use the arcgispro-py3 environment with the Anaconda installation that comes with ArcGIS Pro, I am able to authenticate and access my items.&lt;/LI&gt;&lt;LI&gt;Again, on the same machine as this example, if I have ArcGIS Pro running, I can use Pro to authenticate. However, I must also be using the arcgispro-py3 environment with the Anaconda installation that comes with ArcGIS Pro.&lt;/LI&gt;&lt;LI&gt;Using an entirely different machine running Ubuntu, I created the same environment OAuth 2.0 process as above and was successful in accessing my content.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone encountered this issue before? Any thoughts on how to troubleshoot?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 06:41:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/logged-into-agol-via-python-api-but-can-t-access/m-p/716802#M96</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T06:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: Logged into AGOL via Python API but can't access my items</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/logged-into-agol-via-python-api-but-can-t-access/m-p/716803#M97</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ryan, I was having the same frustrations as you and I ended up calling ESRI for assistance. Basically, it doesn't matter what your organization privileges are or even if you own the data. The item&amp;nbsp;&lt;EM&gt;must&lt;/EM&gt; be shared publicly in order to be accessible via gis.content.get&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even the analyst on the phone agreed with me that seems to restrict the ability to use the API as an organizational administrator but that is how the API is currently written.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jul 2018 21:14:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/logged-into-agol-via-python-api-but-can-t-access/m-p/716803#M97</guid>
      <dc:creator>Zach_Robinson</dc:creator>
      <dc:date>2018-07-27T21:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: Logged into AGOL via Python API but can't access my items</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/logged-into-agol-via-python-api-but-can-t-access/m-p/716804#M98</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for sharing your experience. I have managed to use gis.content.get to access private items using the username and password of a public account associated with our organization. Not really ideal because almost nobody in our organization authenticates this way. Especially since our org is going all-in on AGOL, it's frustrating to find out that ownership doesn't really mean ownership.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2018 13:48:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/logged-into-agol-via-python-api-but-can-t-access/m-p/716804#M98</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2018-07-30T13:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Logged into AGOL via Python API but can't access my items</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/logged-into-agol-via-python-api-but-can-t-access/m-p/716805#M99</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The following code displays private items for me:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; IPython&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;display &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; display
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcgis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;gis &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; GIS

ItemId &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'bc9f80dd6ea341f9b420i1998c07ec05'&lt;/SPAN&gt;
PortalUserName &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'myCaseSensitiveUsername'&lt;/SPAN&gt;
PortalPassword &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'myPassword'&lt;/SPAN&gt;
PortalUrl &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fwww.arcgis.com" target="_blank"&gt;https://www.arcgis.com&lt;/A&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/SPAN&gt;
PortalCertVerification &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;

gis &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; GIS&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;PortalUrl&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; PortalUserName&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; PortalPassword&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; verify_cert&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;PortalCertVerification&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
itemObject &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;content&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;get&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ItemId&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
display&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;itemObject&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you mentioned it is absolutely possible to access, display and modify private content via the API, and you have it working in various environments.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However this particular case is a little different because of the kind of authentication you are using. When you login using OAuth this way by registering an application, you don't gain access to all content owned by the user - there are various built in limitations, as documented&amp;nbsp;&lt;A href="https://developers.arcgis.com/documentation/core-concepts/security-and-authentication/limitations-of-application-authentication/" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;&amp;nbsp;(also listed below):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Tokens obtained by applications can only read public content and services. Although you cannot use an App login with private content, if your goal is to distribute or sell an app to organizations without ArcGIS Online (no named users), you may control access to your content by using your own login mechanism (I.e. Identity) to the app.&lt;/LI&gt;&lt;LI&gt;Tokens obtained by applications may read premium content and services hosted by Esri and consume credits on behalf of the application organization.&lt;/LI&gt;&lt;LI&gt;Applications cannot create, update, share, modify, or delete items (layers, files, services, maps) in ArcGIS Online or ArcGIS Enterprise.&lt;/LI&gt;&lt;LI&gt;Applications built using app login cannot be listed in the ArcGIS Marketplace.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is most likely the cause of the permissions message you are getting, and is by design. In order to&amp;nbsp;access private content, you will have to work with one of the &lt;A class="link-titled" href="https://developers.arcgis.com/python/guide/working-with-different-authentication-schemes/" title="https://developers.arcgis.com/python/guide/working-with-different-authentication-schemes/" rel="nofollow noopener noreferrer" target="_blank"&gt;other authentication schemes&lt;/A&gt;&amp;nbsp;available with the API.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 06:41:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/logged-into-agol-via-python-api-but-can-t-access/m-p/716805#M99</guid>
      <dc:creator>MichaelKelly</dc:creator>
      <dc:date>2021-12-12T06:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: Logged into AGOL via Python API but can't access my items</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/logged-into-agol-via-python-api-but-can-t-access/m-p/716806#M100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your response, Michael. We use ADFS to authenticate, so the example you've include unfortunately doesn't apply to my organization. I have tried adapting the the Active Directory instructions on the link you included, but have been unable to successfully authenticate. I've had trouble determining what the webadapter name and domain are. Regardless OAuth through an app is the only authentication scheme I've gotten to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there an explanation for why this restriction on tokens obtained by applications exists? I'm just a little confused as to why this sort of authentication is sufficient for me to access premium content available through my organizations ELA, but not enough for me to access items that are mine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2018 13:54:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/logged-into-agol-via-python-api-but-can-t-access/m-p/716806#M100</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2018-08-07T13:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: Logged into AGOL via Python API but can't access my items</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/logged-into-agol-via-python-api-but-can-t-access/m-p/716807#M101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Following up on my attempt to authenticate using the Active Directory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's what is listed on the website about authenticating using the Python API:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcgis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;gis &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; GIS

gis &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; GIS&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fportalname.domain.com%2Fwebadapter_name" target="_blank"&gt;https://portalname.domain.com/webadapter_name&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"AVWORLD\\Publisher"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"password"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have to admit I don't have the language to speak to the difference between Portal and...well I'm not sure what else...but what I can say is all our data, maps, and apps are on ArcGIS Online as a part of our Organization. As for domain, I have used the one found under my Windows system information:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/418256_domain-1.JPG" /&gt;&lt;/P&gt;&lt;P&gt;So based on the template above, I thought I'd be able to authenticate with the following:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;gis &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; GIS&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fral.maps.arcgis.com%2Farcgis" target="_blank"&gt;https://ral.maps.arcgis.com/arcgis&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ci.raleigh.nc.us\\{USERNAME}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"{PASSWORD}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However, I just get a 404 error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've spoken with our IT/GIS department and they seemed to thing I was using the correct web adaptor and domain names, but still no dice. Any recommendations?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 06:41:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/logged-into-agol-via-python-api-but-can-t-access/m-p/716807#M101</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T06:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: Logged into AGOL via Python API but can't access my items</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/logged-into-agol-via-python-api-but-can-t-access/m-p/716808#M102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you're nearly there. The Portal URL you are providing does not exist (hence the 404), you need something like this (note 'home' vs 'arcgis'):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcgis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;gis &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; GIS

PortalUsername &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'ci.raleigh.nc.us\\yourUsername'&lt;/SPAN&gt;
PortalPassword &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'yourPassword'&lt;/SPAN&gt;
PortalUrl &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fral.maps.arcgis.com%2Fhome" target="_blank"&gt;https://ral.maps.arcgis.com/home&lt;/A&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/SPAN&gt;

gis &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; GIS&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;PortalUrl&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; PortalUsername&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; PortalPassword&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Logged in as: "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;properties&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;user&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;username&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any joy with this? An alternative would be to&amp;nbsp;use an ArcGIS Online Named User which doesn't use ADFS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The aim of app logins is to allow the use of premium content in ArcGIS Online without having to sign in. Essentially it is an authentication mechanism which&amp;nbsp;allows the use of premium services publically (credits are consumed by the app login user where appropriate). It is not intended to grant access to content owned by the user in question. It is typically used in combination with various API's/SDK's.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mikie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 06:41:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/logged-into-agol-via-python-api-but-can-t-access/m-p/716808#M102</guid>
      <dc:creator>MichaelKelly</dc:creator>
      <dc:date>2021-12-12T06:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: Logged into AGOL via Python API but can't access my items</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/logged-into-agol-via-python-api-but-can-t-access/m-p/716809#M103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would also suggest you try connecting &lt;A href="https://developers.arcgis.com/python/guide/working-with-different-authentication-schemes/#Connecting-through-ArcGIS-Pro"&gt;via ArcGIS Pro&lt;/A&gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;gis &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; GIS&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"pro"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will use&amp;nbsp;the active user in ArcGIS Pro.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2018 15:27:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/logged-into-agol-via-python-api-but-can-t-access/m-p/716809#M103</guid>
      <dc:creator>MichaelKelly</dc:creator>
      <dc:date>2018-08-09T15:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: Logged into AGOL via Python API but can't access my items</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/logged-into-agol-via-python-api-but-can-t-access/m-p/716810#M104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ryan - what did you end up doing to get this to work for you? I'm in the same boat with ADFS as the enterprise standard.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2018 15:47:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/logged-into-agol-via-python-api-but-can-t-access/m-p/716810#M104</guid>
      <dc:creator>AllWeatherHeather</dc:creator>
      <dc:date>2018-12-27T15:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: Logged into AGOL via Python API but can't access my items</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/logged-into-agol-via-python-api-but-can-t-access/m-p/716811#M105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Heather-&lt;/P&gt;&lt;P&gt;I wish I had better news, but unfortunately I was never able to successfully authenticate using the&amp;nbsp;Python API via ADFS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2019 14:01:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/logged-into-agol-via-python-api-but-can-t-access/m-p/716811#M105</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2019-01-02T14:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Logged into AGOL via Python API but can't access my items</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/logged-into-agol-via-python-api-but-can-t-access/m-p/716812#M106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any luck authenticating AGOL with ADFS using Python API? Did you end up having plan B?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Aug 2019 21:35:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/logged-into-agol-via-python-api-but-can-t-access/m-p/716812#M106</guid>
      <dc:creator>NareshAligeti1</dc:creator>
      <dc:date>2019-08-19T21:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: Logged into AGOL via Python API but can't access my items</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/logged-into-agol-via-python-api-but-can-t-access/m-p/716813#M107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/2981"&gt;Michael Kelly&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;I am getting this error just accessing the &lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt;shared_with&lt;/SPAN&gt;&amp;nbsp;property of an Item (a hosted feature layer, in this case). It is very strange, because the same code does not have this problem with a different hosted feature layer. This is a property of the item and should not be reaching out to AGOL to access it, so my&amp;nbsp;gut is telling me that this is &lt;STRONG&gt;NOT&lt;/STRONG&gt; some AGOL permission error, despite the error output text. (At least in my case, not sure about the original post.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I stop the code in debug mode, my debugger says it is unable to get repr (i.e.: string representation) for the &lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt;shared_with&lt;/SPAN&gt;&amp;nbsp;property, it's &lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt;groups&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;list and the 2nd member of that list.&amp;nbsp;The&amp;nbsp;&lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt;org&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and &lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt;everyone&lt;/SPAN&gt;&amp;nbsp;bool elements that look right. The item is shared with 2 groups (the 1st and 3rd with the names crossed out), but for some reason, there is a 3rd group in the list.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/501320_pastedImage_3.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure if my problem is the same as yours, but this feels like an Esri bug, not some actual permissions error. I got the same error just trying to print the &lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt;item.shared_with&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See attached file for the errors I was able to produce when I stopped my code in debug mode using Eclipse PyDev as my IDE. I poked at the object and was able to produce the error trying to access each of the yellow highlighted elements in my screenshot. Here is the short version:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt;&amp;gt;&amp;gt;&amp;gt; item&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt;&amp;lt;Item title:"&amp;lt;_redacted_&amp;gt;" type:Feature Layer Collection owner:&amp;lt;_redacted_&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt;&amp;gt;&amp;gt;&amp;gt; item.shared_with&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt; File "C:\eclipse\plugins\org.python.pydev.core_7.6.0.202006041357\pysrc\_pydevd_bundle\pydevd_exec2.py", line 3, in Exec&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt; exec(exp, global_vars, local_vars)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt; File "&amp;lt;console&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt; File "C:\Users\username\AppData\Local\ESRI\conda\envs\dev\lib\site-packages\arcgis\gis\__init__.py", line 5562, in __repr__&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt; return '&amp;lt;%s title:"%s" owner:%s&amp;gt;' % (type(self).__name__, self.title, self.owner)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt; File "C:\Users\username\AppData\Local\ESRI\conda\envs\dev\lib\site-packages\arcgis\gis\__init__.py", line 5540, in __getattr__&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt; self._hydrate()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt; File "C:\Users\username\AppData\Local\ESRI\conda\envs\dev\lib\site-packages\arcgis\gis\__init__.py", line 5533, in _hydrate&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt; groupdict = self._portal.get_group(self.groupid)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt; File "C:\Users\username\AppData\Local\ESRI\conda\envs\dev\lib\site-packages\arcgis\gis\_impl\_portalpy.py", line 906, in get_group&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt; return self.con.post('community/groups/' + group_id, self._postdata())&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt; File "C:\Users\username\AppData\Local\ESRI\conda\envs\dev\lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 694, in post&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt; force_bytes=kwargs.pop('force_bytes', False))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt; File "C:\Users\username\AppData\Local\ESRI\conda\envs\dev\lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 493, in _handle_response&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt; self._handle_json_error(data['error'], errorcode)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt; File "C:\Users\username\AppData\Local\ESRI\conda\envs\dev\lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 511, in _handle_json_error&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt; raise Exception(errormessage)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt;Exception: You do not have permissions to access this resource or perform this operation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; color: #993300;"&gt;(Error Code: 403)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2020 23:49:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/logged-into-agol-via-python-api-but-can-t-access/m-p/716813#M107</guid>
      <dc:creator>davedoesgis</dc:creator>
      <dc:date>2020-07-24T23:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: Logged into AGOL via Python API but can't access my items</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/logged-into-agol-via-python-api-but-can-t-access/m-p/1007451#M5283</link>
      <description>&lt;P&gt;More than 2 years after asking this question and forgetting about it, I happened upon this thread while troubleshooting a similar inability to access non-public items that are either mine or accessible to me via sharing. I'm better at Python now so I was able to hack together a workaround that may be useful for others.&amp;nbsp;Basically, it involves circumventing the ArcGIS Python API and instead using &lt;FONT face="terminal,monaco"&gt;requests&lt;/FONT&gt; to return a JSON response with your data. From there, you can use pandas or, in my case, geopandas, to get the data in a more table-like format.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import requests
import json
from arcgis.gis import GIS

gis = GIS("https://myorg.maps.arcgis.com", client_id='abc123', verify_cert = True)

layer_url = 'https://services.arcgis.com/myorg/arcgis/rest/services/my_layer/FeatureServer/0/query'
layer_params = {
    "where": "1=1",
    "f": "geojson",
    "outSR": 4326,
    "outFields": "*",
    "token": gis._con.token
}

layer_r = requests.get(layer_url, layer_params)
layer_json = json.dumps(layer_r.json())&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I still don't understand why authenticating with OAuth2 has any bearing on accessing private items through the Python API, but if you're just trying to get at the data in a non-public layer, this may work for you.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 17:27:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/logged-into-agol-via-python-api-but-can-t-access/m-p/1007451#M5283</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-12-07T17:27:13Z</dc:date>
    </item>
  </channel>
</rss>

