<?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 Using Credential.token in REST API in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/using-credential-token-in-rest-api/m-p/1022896#M3934</link>
    <description>&lt;P&gt;I want to run multiple concurrent count queries on the same layer but the sdk does not provide that, so I turned to the REST API which does. I would like to use the existing&amp;nbsp;Credential.token, but it doesn't work because it requires&amp;nbsp;referer: runtimeqtsdk as a header which I cannot set using&amp;nbsp;XMLHttpRequest.&lt;/P&gt;&lt;P&gt;Any suggestions on using this token so I don't have to manage tokens myself? Seems like there should be a reason the sdk allows access to the token and&amp;nbsp;referer of the&amp;nbsp;Credential.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 03 Feb 2021 06:39:23 GMT</pubDate>
    <dc:creator>MarkHolm</dc:creator>
    <dc:date>2021-02-03T06:39:23Z</dc:date>
    <item>
      <title>Using Credential.token in REST API</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/using-credential-token-in-rest-api/m-p/1022896#M3934</link>
      <description>&lt;P&gt;I want to run multiple concurrent count queries on the same layer but the sdk does not provide that, so I turned to the REST API which does. I would like to use the existing&amp;nbsp;Credential.token, but it doesn't work because it requires&amp;nbsp;referer: runtimeqtsdk as a header which I cannot set using&amp;nbsp;XMLHttpRequest.&lt;/P&gt;&lt;P&gt;Any suggestions on using this token so I don't have to manage tokens myself? Seems like there should be a reason the sdk allows access to the token and&amp;nbsp;referer of the&amp;nbsp;Credential.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 06:39:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/using-credential-token-in-rest-api/m-p/1022896#M3934</guid>
      <dc:creator>MarkHolm</dc:creator>
      <dc:date>2021-02-03T06:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: Using Credential.token in REST API</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/using-credential-token-in-rest-api/m-p/1023160#M3936</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/300942"&gt;@MarkHolm&lt;/a&gt;&amp;nbsp;.&amp;nbsp; How many concurrent count operations are you looking to run? Rather than trying to access the rest API directly, you can spin up multiple API objects and run one async task per object. Each object will persist the result once completed. I realize that's a workaround, but it might be easier to trying to reuse API tokens with the REST Api.&lt;/P&gt;&lt;P&gt;Can you please share which specific API call you're wanting to call concurrently?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 19:54:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/using-credential-token-in-rest-api/m-p/1023160#M3936</guid>
      <dc:creator>JamesBallard1</dc:creator>
      <dc:date>2021-02-03T19:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using Credential.token in REST API</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/using-credential-token-in-rest-api/m-p/1023167#M3937</link>
      <description>&lt;P&gt;I am running a count query on a whereClause with many non unique id's in an in statement on layer to determine if the feature query will exceed the maxRecordCount. The count is more useful than the&amp;nbsp;&lt;SPAN class="name"&gt;transferLimitExceeded bool returned on the&amp;nbsp;FeatureQueryResult, so I can estimate how many smaller queries to break it down into. Feature querying can run concurrent&amp;nbsp;&lt;SPAN&gt;operations, but sadly count queries cannot.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="name"&gt;&lt;SPAN&gt;Specifically I am using&amp;nbsp;queryFeatureCount on the FeatureTable&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 20:12:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/using-credential-token-in-rest-api/m-p/1023167#M3937</guid>
      <dc:creator>MarkHolm</dc:creator>
      <dc:date>2021-02-03T20:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using Credential.token in REST API</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/using-credential-token-in-rest-api/m-p/1023180#M3938</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/300942"&gt;@MarkHolm&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you try to use &lt;STRONG&gt;setRequestHeader&lt;/STRONG&gt;?&amp;nbsp;&lt;A href="https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/setRequestHeader" target="_blank"&gt;https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/setRequestHeader&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Something likes (not tested):&lt;/P&gt;&lt;PRE&gt;var request = new XMLHttpRequest();&lt;BR /&gt;request.onreadystatechange = function() {&lt;BR /&gt;    if (request.readyState === XMLHttpRequest.DONE)&lt;BR /&gt;        console.log(request.getAllResponseHeaders());&lt;BR /&gt;}&lt;BR /&gt;request.open("GET", url);&lt;BR /&gt;request.setRequestHeader("referer", credential.referer);&lt;BR /&gt;request.send();&lt;/PRE&gt;&lt;P&gt;If this doesn't work, that means the support of&amp;nbsp;&lt;STRONG&gt;XMLHttpRequest&lt;/STRONG&gt; in Qt is not correct. In this case, you can use&amp;nbsp;&lt;STRONG&gt;QNetworkAccessManager&lt;/STRONG&gt; in C++ for theses requests.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 20:33:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/using-credential-token-in-rest-api/m-p/1023180#M3938</guid>
      <dc:creator>GuillaumeBelz</dc:creator>
      <dc:date>2021-02-03T20:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Using Credential.token in REST API</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/using-credential-token-in-rest-api/m-p/1023213#M3939</link>
      <description>&lt;P&gt;I have and it does not work because&amp;nbsp;referer is one of the&amp;nbsp;forbidden header names in the&amp;nbsp;XMLHttpRequest specification.&lt;/P&gt;&lt;P&gt;&lt;A href="https://xhr.spec.whatwg.org/#the-setrequestheader()-method" target="_blank"&gt;https://xhr.spec.whatwg.org/#the-setrequestheader()-method&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I thought about using&amp;nbsp;QNetworkAccessManager, but the multiple API objects should be an easier approach.&lt;/P&gt;&lt;P&gt;I also tried looking at the&amp;nbsp;AuthenticationManager or credential to see if I could generate a token not using referer: runtimeqtsdk, but the only method I found was removing the&amp;nbsp;referer from the credential after the token is generated which doesn't work&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 21:40:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/using-credential-token-in-rest-api/m-p/1023213#M3939</guid>
      <dc:creator>MarkHolm</dc:creator>
      <dc:date>2021-02-03T21:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using Credential.token in REST API</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/using-credential-token-in-rest-api/m-p/1023220#M3940</link>
      <description>&lt;P&gt;Good point for the forbidden header names.&lt;/P&gt;&lt;P&gt;If the solution proposed by&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/405084"&gt;@JamesBallard1&lt;/a&gt;&amp;nbsp;&amp;nbsp;works fine, this is the easiest way to do. And you can use the C++ solution only if you have a performance issue.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 22:01:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/using-credential-token-in-rest-api/m-p/1023220#M3940</guid>
      <dc:creator>GuillaumeBelz</dc:creator>
      <dc:date>2021-02-03T22:01:32Z</dc:date>
    </item>
  </channel>
</rss>

