<?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: Best way for dealing with password changes for accounts needed to run scripts? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/best-way-for-dealing-with-password-changes-for/m-p/1104434#M6713</link>
    <description>&lt;P&gt;Unfortunately, not with the ArcGIS API for Python.&amp;nbsp; When trying to do so, a browser is opened asking for credentials.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/python/guide/working-with-different-authentication-schemes/" target="_blank"&gt;https://developers.arcgis.com/python/guide/working-with-different-authentication-schemes/&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Oct 2021 15:50:55 GMT</pubDate>
    <dc:creator>JakeSkinner</dc:creator>
    <dc:date>2021-10-04T15:50:55Z</dc:date>
    <item>
      <title>Best way for dealing with password changes for accounts needed to run scripts?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/best-way-for-dealing-with-password-changes-for/m-p/1104404#M6708</link>
      <description>&lt;P&gt;My org uses ArcGIS Online and we have a number of python scripts currently using named users to authenticate with AGOL via the python api. The issue is that we must use a password policy and have passwords reset every x amount of days. The API does not seem to have any way to check when an accounts password will expire. Problematic as I have 5 or 6 accounts running scripts (use a dedicated account for each grouping of servers to prevent conflicts as 1 account can only be used on 3 machines at a time) and it's a hassle to manual manage all of them. I want to be programmatically check when a password will need to be changed so I can automate the reset and updating of the stored passwords in protected directories.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Before I come up with my own solution, I was wondering if there is a better way to deal with this? Maybe I missed something and there is a more permanent way to authenticate without using an on-prem Portal. Or there is something in the API refs I missed. It seems I'll have to store a log of when passwords were reset.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;As far as I can tell from the documentation this or using ArcGIS Pro authentication are the only ways to connect to AGOL and run our scripts...pro auth token will only last two weeks so that's out of the window (unless there is someway to specify a longer default token parameter for Pro with AGOL, but there does not seem to be)&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 14:37:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/best-way-for-dealing-with-password-changes-for/m-p/1104404#M6708</guid>
      <dc:creator>CarlVricella</dc:creator>
      <dc:date>2021-10-04T14:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: Best way for dealing with password changes for accounts needed to run scripts?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/best-way-for-dealing-with-password-changes-for/m-p/1104419#M6709</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/19033"&gt;@CarlVricella&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You can use an Oauth2.0 Application to generate your token:&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; In ArcGIS Online go to Content &amp;gt; New Item &amp;gt; Application&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; Other application &amp;gt; Next&lt;/P&gt;&lt;P&gt;3.&amp;nbsp; Specify a Title and Tags and click Save&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JakeSkinner_0-1633360918484.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/24454i53B0A499AAB2235E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JakeSkinner_0-1633360918484.png" alt="JakeSkinner_0-1633360918484.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4.&amp;nbsp; In the Items Details of the new application, click the Settings tab&lt;/P&gt;&lt;P&gt;5.&amp;nbsp; Scroll down and click Registered Info&lt;/P&gt;&lt;P&gt;6.&amp;nbsp; Copy the App ID and App Secret&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JakeSkinner_1-1633360994501.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/24455i1A7CF200B92B11C5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JakeSkinner_1-1633360994501.png" alt="JakeSkinner_1-1633360994501.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;7.&amp;nbsp; You can then use this to generate a token:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import requests, json

# Generate Token
try:
    params = {
        'client_id': clientId,
        'client_secret': clientSecret,
        'grant_type': "client_credentials",
    }
    request = requests.get('https://www.arcgis.com/sharing/oauth2/token', params=params)
    response = request.json()
    token = response["access_token"]
except Exception as e:
    errorLog("Error generating token", e)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 04 Oct 2021 15:26:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/best-way-for-dealing-with-password-changes-for/m-p/1104419#M6709</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-10-04T15:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: Best way for dealing with password changes for accounts needed to run scripts?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/best-way-for-dealing-with-password-changes-for/m-p/1104420#M6710</link>
      <description>Ah cool, so if I do it like this even if the password expires on the account that registered the application I can still generate the access token indefinitely?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 04 Oct 2021 15:28:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/best-way-for-dealing-with-password-changes-for/m-p/1104420#M6710</guid>
      <dc:creator>CarlVricella</dc:creator>
      <dc:date>2021-10-04T15:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: Best way for dealing with password changes for accounts needed to run scripts?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/best-way-for-dealing-with-password-changes-for/m-p/1104421#M6711</link>
      <description>&lt;P&gt;Correct, the expiration of the application owner's password should not interfere.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 15:31:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/best-way-for-dealing-with-password-changes-for/m-p/1104421#M6711</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-10-04T15:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: Best way for dealing with password changes for accounts needed to run scripts?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/best-way-for-dealing-with-password-changes-for/m-p/1104432#M6712</link>
      <description>&lt;P&gt;and I can provide this token to initiate a connection AGOL via the python api's GIS module?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 15:41:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/best-way-for-dealing-with-password-changes-for/m-p/1104432#M6712</guid>
      <dc:creator>CarlVricella</dc:creator>
      <dc:date>2021-10-04T15:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: Best way for dealing with password changes for accounts needed to run scripts?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/best-way-for-dealing-with-password-changes-for/m-p/1104434#M6713</link>
      <description>&lt;P&gt;Unfortunately, not with the ArcGIS API for Python.&amp;nbsp; When trying to do so, a browser is opened asking for credentials.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/python/guide/working-with-different-authentication-schemes/" target="_blank"&gt;https://developers.arcgis.com/python/guide/working-with-different-authentication-schemes/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 15:50:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/best-way-for-dealing-with-password-changes-for/m-p/1104434#M6713</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-10-04T15:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Best way for dealing with password changes for accounts needed to run scripts?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/best-way-for-dealing-with-password-changes-for/m-p/1496071#M10224</link>
      <description>&lt;P&gt;is OAuth still not support by the python API?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2024 16:37:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/best-way-for-dealing-with-password-changes-for/m-p/1496071#M10224</guid>
      <dc:creator>CarlVricella</dc:creator>
      <dc:date>2024-06-21T16:37:31Z</dc:date>
    </item>
  </channel>
</rss>

