I'm trying to login to Portal using the ArcGIS API for Python, but under a different user than my windows authentication user (python with OAuth 2.0 or the original Admin user). Unfortunately every time I attempt to log in as a different user, the Portal recognizes my windows authentication username and password and logs me in under that user instead. Has anyone else ran into this issue and found a solution? Below is an example of my code and the responses:
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"\n\nIntegrated Windows Authentication using NTLM or Kerberos"</SPAN><SPAN class="punctuation token">)</SPAN>
gis <SPAN class="operator token">=</SPAN> GIS<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"https://my.portal.org/portal"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Logged in as: "</SPAN> <SPAN class="operator token">+</SPAN> gis<SPAN class="punctuation token">.</SPAN>properties<SPAN class="punctuation token">.</SPAN>user<SPAN class="punctuation token">.</SPAN>username<SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Integrated Windows Authentication using NTLM or Kerberos</SPAN>
<SPAN class="comment token"># Logged in as: me@activedirectory</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"\n\nPortal-tier Authentication with LDAP - enterprise user"</SPAN><SPAN class="punctuation token">)</SPAN>
gisldap <SPAN class="operator token">=</SPAN> GIS<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"https://my.portal.org/portal"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"activedirectory\\originalAdmin"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"password"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Logged in as: "</SPAN> <SPAN class="operator token">+</SPAN> gisldap<SPAN class="punctuation token">.</SPAN>properties<SPAN class="punctuation token">.</SPAN>user<SPAN class="punctuation token">.</SPAN>username<SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Portal-tier Authentication with LDAP - enterprise user</SPAN>
<SPAN class="comment token"># Logged in as: me@activedirectory</SPAN>
pythongis <SPAN class="operator token">=</SPAN> GIS<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"https://my.portal.org/portal"</SPAN><SPAN class="punctuation token">,</SPAN> client_id<SPAN class="operator token">=</SPAN><SPAN class="string token">'pythonappid'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Successfully logged in as: "</SPAN> <SPAN class="operator token">+</SPAN> pythongis<SPAN class="punctuation token">.</SPAN>properties<SPAN class="punctuation token">.</SPAN>user<SPAN class="punctuation token">.</SPAN>username<SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Successfully logged in as: me@activedirectory</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Thanks,
Josh