<?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: Using FeatureServiceManager in ArcGIS AppStudio Questions</title>
    <link>https://community.esri.com/t5/arcgis-appstudio-questions/using-featureservicemanager/m-p/810745#M1591</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Mar 2017 20:57:41 GMT</pubDate>
    <dc:creator>KE</dc:creator>
    <dc:date>2017-03-30T20:57:41Z</dc:date>
    <item>
      <title>Using FeatureServiceManager</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/using-featureservicemanager/m-p/810743#M1589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a question about working with secured feature services in the Quick Report App. I thought adding the username and password into the appinfo.json file under properties would work,&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #c0c0c0;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;"properties"&lt;/SPAN&gt;:&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;{&lt;/PRE&gt;&lt;PRE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN style="color: #c0c0c0;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;"password"&lt;/SPAN&gt;:&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;"password"&lt;/SPAN&gt;,&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN style="color: #008000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"username"&lt;/SPAN&gt;:&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;"username"&lt;/SPAN&gt;,&lt;/PRE&gt;&lt;PRE&gt;&lt;/PRE&gt;&lt;P&gt;but I get this error:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/344831_pastedImage_1.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can get the app to work by plugging the username and password into this line in FeatureServiceManage.qml under the generateToken function:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #808000;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #2985c7;"&gt;obj&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;=&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;{&lt;SPAN style="color: #008000;"&gt;"username"&lt;/SPAN&gt;:&lt;SPAN style="color: #008000;"&gt;"username"&lt;/SPAN&gt;,&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;"password"&lt;/SPAN&gt;:&lt;SPAN style="color: #008000;"&gt;"password"&lt;/SPAN&gt;,&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;"f"&lt;/SPAN&gt;:&lt;SPAN style="color: #008000;"&gt;"json"&lt;/SPAN&gt;,&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;referer:&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fwww.arcgis.com" rel="nofollow" target="_blank"&gt;http://www.arcgis.com&lt;/A&gt;&lt;SPAN&gt;"/*,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;expiration:"1"*/&lt;/SPAN&gt;};&lt;/PRE&gt;&lt;P&gt;But my guess is that’s not how it is supposed to work. Am I missing something?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;I am using AppStudio for ArcGIS (Desktop Edition) 1.4.18 and the Quick Report template.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;My app is for the public to submit sensitive information to a public safety customer. So I need for the public to be able to edit the feature service, but I do not want the public to be able to access the rest endpoint of my feature service. &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Mar 2017 18:42:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/using-featureservicemanager/m-p/810743#M1589</guid>
      <dc:creator>KE</dc:creator>
      <dc:date>2017-03-30T18:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using FeatureServiceManager</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/using-featureservicemanager/m-p/810744#M1590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kristen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Glad to help you about this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you simply set username and password in the appinfo.json&amp;nbsp;without any code change, it would not help you to generate token automatically. This is because the app always tries to read username and password from app's settings file (which is different from appinfo.json). The appinfo.json, on the other hand, is used to configure the app when you initialize it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In details, the appinfo.json is used to initialize the app (you cannot change in the app). The settings file&amp;nbsp;is the file which saved all information you want to change and keep when you open the app next time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case, you want to use a secured service without asking users to input the username and password. This is&amp;nbsp;easy to do by using the template. Just do the following things:&lt;/P&gt;&lt;P&gt;- set username and password in the appinfo.json&amp;nbsp;(which you have already done)&lt;/P&gt;&lt;P&gt;- Inside the function generateToken(), using&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var user = app.info.propertyValue("username","");
var pwd = app.info.propertyValue("password","");
var obj = {"username":user, "password":pwd, "f":"json", referer: "&lt;A href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fwww.arcgis.com" target="_blank"&gt;http://www.arcgis.com&lt;/A&gt;"/*, expiration:"1"*/};&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This will read the username and password from the appinfo.json and try to use them to generate token.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;LG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:56:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/using-featureservicemanager/m-p/810744#M1590</guid>
      <dc:creator>LiweiGao</dc:creator>
      <dc:date>2021-12-12T16:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using FeatureServiceManager</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/using-featureservicemanager/m-p/810745#M1591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Mar 2017 20:57:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/using-featureservicemanager/m-p/810745#M1591</guid>
      <dc:creator>KE</dc:creator>
      <dc:date>2017-03-30T20:57:41Z</dc:date>
    </item>
  </channel>
</rss>

