<?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 Custom GP Tool: Common Tool with user credentials in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/custom-gp-tool-common-tool-with-user-credentials/m-p/1596996#M11257</link>
    <description>&lt;P&gt;I am facing the challenge that I want to provide a GP tool on an ArcGIS Server 11.3, which should always use the credentials of the calling user when running.&lt;BR /&gt;The call is made from an Experience Builder client so that I can customize the request accordingly.&lt;BR /&gt;One possible solution would be to set up a separate parameter for the user token or the username. However, I don't like this solution for several reasons. I actually only want to receive the information required for processing in the parameters and not credentials. In addition, the signature of the tool would change. And I would have to do this for all my tools.&lt;BR /&gt;I would prefer a transfer via the HTTP header. But I can't find a way to read the HTTP header in the context of an ArcGIS Server GP tool.&lt;BR /&gt;An SOI doesn't seem to help either, as this can only be used for MapServices.&lt;BR /&gt;Is it possible to access the HTTP header information within a GP Tool in ArcGIS?&lt;BR /&gt;Are there any other ideas to realize this?&lt;/P&gt;</description>
    <pubDate>Wed, 19 Mar 2025 11:20:33 GMT</pubDate>
    <dc:creator>MaximilianGlas</dc:creator>
    <dc:date>2025-03-19T11:20:33Z</dc:date>
    <item>
      <title>Custom GP Tool: Common Tool with user credentials</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/custom-gp-tool-common-tool-with-user-credentials/m-p/1596996#M11257</link>
      <description>&lt;P&gt;I am facing the challenge that I want to provide a GP tool on an ArcGIS Server 11.3, which should always use the credentials of the calling user when running.&lt;BR /&gt;The call is made from an Experience Builder client so that I can customize the request accordingly.&lt;BR /&gt;One possible solution would be to set up a separate parameter for the user token or the username. However, I don't like this solution for several reasons. I actually only want to receive the information required for processing in the parameters and not credentials. In addition, the signature of the tool would change. And I would have to do this for all my tools.&lt;BR /&gt;I would prefer a transfer via the HTTP header. But I can't find a way to read the HTTP header in the context of an ArcGIS Server GP tool.&lt;BR /&gt;An SOI doesn't seem to help either, as this can only be used for MapServices.&lt;BR /&gt;Is it possible to access the HTTP header information within a GP Tool in ArcGIS?&lt;BR /&gt;Are there any other ideas to realize this?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2025 11:20:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/custom-gp-tool-common-tool-with-user-credentials/m-p/1596996#M11257</guid>
      <dc:creator>MaximilianGlas</dc:creator>
      <dc:date>2025-03-19T11:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Custom GP Tool: Common Tool with user credentials</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/custom-gp-tool-common-tool-with-user-credentials/m-p/1608273#M11336</link>
      <description>&lt;P&gt;One of the first Custom widgets I worked on, we had to validate a user against the auth point and get a token, then call a feature layer with parameters and pass the token with it to give it authorization.&amp;nbsp; If the GPTool had the ability to do something similar, take a auth token and map what it does scoped based on that, I think it could be passed in that way.&lt;BR /&gt;&lt;BR /&gt;Otherwise, the only auth parts I've seen that might relate are creating the OAuth2.0 or client ID when setting up a client to run Experience Builder on a server (local EXB for eaxmple)&lt;BR /&gt;&lt;BR /&gt;I don't know if the GP Tool itself is aware of the HTTP Headers, so I don't think that is possible, but you should be able to explicitly pass a value (like the token I described) to the gptool and it be consumed.&lt;BR /&gt;Ther eis a command somewhere that looks like:&lt;BR /&gt;&lt;BR /&gt;GetActivePortalUser&lt;BR /&gt;&lt;BR /&gt;I did find this over on Stack Exchange if that is helpful somehow:&lt;BR /&gt;&lt;A href="https://gis.stackexchange.com/questions/336621/get-arcgis-pro-portal-user" target="_blank"&gt;https://gis.stackexchange.com/questions/336621/get-arcgis-pro-portal-user&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I know the portal somehow knows who is logged in.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/python/latest/guide/accessing-and-managing-users/" target="_blank"&gt;https://developers.arcgis.com/python/latest/guide/accessing-and-managing-users/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Feels like there ought to be a way to get information about the current logged in user somehow.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Apr 2025 20:36:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/custom-gp-tool-common-tool-with-user-credentials/m-p/1608273#M11336</guid>
      <dc:creator>TimWestern</dc:creator>
      <dc:date>2025-04-22T20:36:22Z</dc:date>
    </item>
  </channel>
</rss>

