<?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: QML ArcGIS Runtime API - generate a new token in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1269682#M4889</link>
    <description>&lt;P&gt;So &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/184785"&gt;@LucasDanzinger&lt;/a&gt; if using oAuth, could this example be as simple as using the existing credential's &lt;STRONG&gt;refreshToken&lt;/STRONG&gt; to create a new Credential and pass that to &lt;STRONG&gt;challenge.continueWithCredential(credential)&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;I'm trying to refresh a token without prompting the user to log in again. Or, in my case, the app just hangs and 'acts weird' when the token expires. Thanks for any help.&lt;/P&gt;</description>
    <pubDate>Mon, 20 Mar 2023 22:17:09 GMT</pubDate>
    <dc:creator>DavidPuckett</dc:creator>
    <dc:date>2023-03-20T22:17:09Z</dc:date>
    <item>
      <title>QML ArcGIS Runtime API - generate a new token</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1212408#M4735</link>
      <description>&lt;P&gt;Hello everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm actually working on app mobile (doing some basics functionnalities like displaying data and searching the itineraire). The data is a simple web map with a featurelayer stored in the portal federated with the ArcGIS Server&lt;/P&gt;&lt;P&gt;The user can use her enterprise account to access to the portal then get the token to display the web map and the data. The token has 30 minutes to expire.&lt;/P&gt;&lt;P&gt;Now, I would like to generate a new token once the old one has expired without displaying the popup authentication.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am a junior in QT and ArcGIS Runtime API for QML and any advice is the most welcomed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the help&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 13:13:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1212408#M4735</guid>
      <dc:creator>GISiste</dc:creator>
      <dc:date>2022-09-14T13:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: QML ArcGIS Runtime API - generate a new token</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1212468#M4736</link>
      <description>&lt;P&gt;Have you seen the token authentication sample?&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-runtime-samples-qt/tree/main/ArcGISRuntimeSDKQt_QMLSamples/CloudAndPortal/TokenAuthentication" target="_blank"&gt;https://github.com/Esri/arcgis-runtime-samples-qt/tree/main/ArcGISRuntimeSDKQt_QMLSamples/CloudAndPortal/TokenAuthentication&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This makes use of the ArcGIS Runtime Toolkit's AuthenticationView. This component will ask the user to sign in on load, but then will automatically exchange/refresh tokens behind the scenes.&lt;/P&gt;&lt;P&gt;We have other samples as well that showcase how to use OAuth, IWA, and other sign in options.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 15:09:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1212468#M4736</guid>
      <dc:creator>LucasDanzinger</dc:creator>
      <dc:date>2022-09-14T15:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: QML ArcGIS Runtime API - generate a new token</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1212478#M4737</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/184785"&gt;@LucasDanzinger&lt;/a&gt; for your response. I've tested the sample and looks working. I will integrate this into my app and let you know&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 15:30:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1212478#M4737</guid>
      <dc:creator>GISiste</dc:creator>
      <dc:date>2022-09-14T15:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: QML ArcGIS Runtime API - generate a new token</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1212522#M4739</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/184785"&gt;@LucasDanzinger&lt;/a&gt; I've integrated this sample and the authentication popup still displaying when the token is expired.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 16:17:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1212522#M4739</guid>
      <dc:creator>GISiste</dc:creator>
      <dc:date>2022-09-14T16:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: QML ArcGIS Runtime API - generate a new token</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1212844#M4741</link>
      <description>&lt;P&gt;Following up ... is there anyone who had an idea ?&lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 10:53:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1212844#M4741</guid>
      <dc:creator>GISiste</dc:creator>
      <dc:date>2022-09-15T10:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: QML ArcGIS Runtime API - generate a new token</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1213474#M4743</link>
      <description>&lt;P&gt;As far as I know, the username and password supplied by the user &lt;EM&gt;should&lt;/EM&gt; be used to obtain the new token once the old one expires. If that is not the case, then that is a bug in the API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have another suggestion to try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of using the AuthenticationView, you could connect to the AuthenticationManager and respond to credential challenges there. You can intercept the challenge and respond to the challenge programmatically&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Something like:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Connections {
    target: AuthenticationManager
    function onAuthenticationChallenge(challenge) {
        const credential = ArcGISRuntimeEnvironment.createObject("Credential", {username: "", password: ""});
        challenge.continueWithCredential(credential);
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the doc on that&amp;nbsp;&lt;A href="https://developers.arcgis.com/qt/qml/api-reference/qml-esri-arcgisruntime-authenticationmanager.html" target="_blank"&gt;https://developers.arcgis.com/qt/qml/api-reference/qml-esri-arcgisruntime-authenticationmanager.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 16:27:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1213474#M4743</guid>
      <dc:creator>LucasDanzinger</dc:creator>
      <dc:date>2022-09-16T16:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: QML ArcGIS Runtime API - generate a new token</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1218623#M4760</link>
      <description>&lt;P&gt;thanks @ &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;LucasDanzinger&lt;/SPAN&gt;&lt;/SPAN&gt; for youre help. I've tested the suggestion but still get the popup. Then I think this could be a bug in the API.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Hope this will be corrected soon&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2022 14:25:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1218623#M4760</guid>
      <dc:creator>GISiste</dc:creator>
      <dc:date>2022-10-04T14:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: QML ArcGIS Runtime API - generate a new token</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1269682#M4889</link>
      <description>&lt;P&gt;So &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/184785"&gt;@LucasDanzinger&lt;/a&gt; if using oAuth, could this example be as simple as using the existing credential's &lt;STRONG&gt;refreshToken&lt;/STRONG&gt; to create a new Credential and pass that to &lt;STRONG&gt;challenge.continueWithCredential(credential)&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;I'm trying to refresh a token without prompting the user to log in again. Or, in my case, the app just hangs and 'acts weird' when the token expires. Thanks for any help.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2023 22:17:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1269682#M4889</guid>
      <dc:creator>DavidPuckett</dc:creator>
      <dc:date>2023-03-20T22:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: QML ArcGIS Runtime API - generate a new token</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1269898#M4890</link>
      <description>&lt;P&gt;If using OAuth, could you try setting the following OAuthClientInfo property:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;oAuthClientInfo: OAuthClientInfo {
    oAuthMode: Enums.OAuthModeUser
    clientId: appPortal.clientId
    refreshTokenExchangeInterval: 30 // &amp;lt;--- Add this
}&lt;/LI-CODE&gt;&lt;P&gt;The API should use the refresh token to fetch a new access token for you automatically.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 15:48:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1269898#M4890</guid>
      <dc:creator>LucasDanzinger</dc:creator>
      <dc:date>2023-03-21T15:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: QML ArcGIS Runtime API - generate a new token</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1269988#M4891</link>
      <description>&lt;P&gt;Wow. Even easier. I actually had this commented out so you're telling me it would have automatically refreshed the token all along if enabled? &lt;span class="lia-unicode-emoji" title=":face_with_rolling_eyes:"&gt;🙄&lt;/span&gt; If this is the expected behavior then I will assume it works. I will report back otherwise. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 18:27:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1269988#M4891</guid>
      <dc:creator>DavidPuckett</dc:creator>
      <dc:date>2023-03-21T18:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: QML ArcGIS Runtime API - generate a new token</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1270484#M4892</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/7317"&gt;@DavidPuckett&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is that worked for you ?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2023 16:39:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1270484#M4892</guid>
      <dc:creator>GISiste</dc:creator>
      <dc:date>2023-03-22T16:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: QML ArcGIS Runtime API - generate a new token</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1270691#M4895</link>
      <description>&lt;P&gt;Setting the refreshTokenExchangeInterval on the oAuthClientInfo did not work to automatically refresh the token at the set interval.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 00:38:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1270691#M4895</guid>
      <dc:creator>DavidPuckett</dc:creator>
      <dc:date>2023-03-23T00:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: QML ArcGIS Runtime API - generate a new token</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1270692#M4896</link>
      <description>&lt;P&gt;Hmmm &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/184785"&gt;@LucasDanzinger&lt;/a&gt; this did not work. I set the refreshTokenExchangeInterval on the oAuthClientInfo to 30 but it did not work to automatically refresh the token at the set interval. I started the app and let it sit for 30 minutes and sure enough it timed out. Any other tips? Is it dependent on any other properties?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 00:41:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1270692#M4896</guid>
      <dc:creator>DavidPuckett</dc:creator>
      <dc:date>2023-03-23T00:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: QML ArcGIS Runtime API - generate a new token</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1275794#M4914</link>
      <description>&lt;P&gt;we are looking into this still&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2023 14:41:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1275794#M4914</guid>
      <dc:creator>LucasDanzinger</dc:creator>
      <dc:date>2023-04-05T14:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: QML ArcGIS Runtime API - generate a new token</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1276028#M4917</link>
      <description>&lt;P&gt;Appreciate the update. This has turned into a potential issue for us so any further info you can provide would be much appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2023 23:02:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1276028#M4917</guid>
      <dc:creator>DavidPuckett</dc:creator>
      <dc:date>2023-04-05T23:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: QML ArcGIS Runtime API - generate a new token</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1297725#M4961</link>
      <description>&lt;P&gt;Following up to learn if there is more info here. I have since implemented a solution that refreshes the token via a NetworkRequest put on a Timer which works most of the time. However, if the app idles too long in the background the timer will not fire to refresh the access token and the app loses access. This is especially difficult because there is no indication to the user at all. It just doesn't work and there isn't then a way to refresh the token unless I implement a manual way to refresh, inelegant. Any word on whether the refreshTokenExchangeInterval workflow has a workaround here &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/184785"&gt;@LucasDanzinger&lt;/a&gt; ?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:06:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/qml-arcgis-runtime-api-generate-a-new-token/m-p/1297725#M4961</guid>
      <dc:creator>DavidPuckett</dc:creator>
      <dc:date>2023-06-09T19:06:05Z</dc:date>
    </item>
  </channel>
</rss>

