<?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: Security in AppStudio Quick Report in ArcGIS AppStudio Questions</title>
    <link>https://community.esri.com/t5/arcgis-appstudio-questions/security-in-appstudio-quick-report/m-p/770461#M445</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Clarification: I was testing with an http connection but the app will use https.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don’t think solution 2 will work because my service is located on our ArcGIS Server. Also it said a limitation was that the tokens are read only and my users need to edit the feature service.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to figure out how to implement solution 1, I found these directions here &lt;A href="https://developers.arcgis.com/javascript/3/jshelp/ags_proxy.html"&gt;https://developers.arcgis.com/javascript/3/jshelp/ags_proxy.html&lt;/A&gt;&lt;SPAN&gt;. I was able to download the github file and set up the configuration on our webserver (DotNet version: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fgithub.com%2FEsri%2Fresource-proxy%2Ftree%2Fmaster%2FDotNet" rel="nofollow" target="_blank"&gt;https://github.com/Esri/resource-proxy/tree/master/DotNet&lt;/A&gt;&lt;SPAN&gt;). But it looks like I need to setup a proxy rule within the code for my app to tell it to use the proxy. Do I need to&amp;nbsp;add a JavaScript file to my app and use urlUtils.addProxyRule? Or is there qml code that does something similar?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wasn’t able to find any information on salt or authenticated headers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Apr 2017 14:52:41 GMT</pubDate>
    <dc:creator>KE</dc:creator>
    <dc:date>2017-04-12T14:52:41Z</dc:date>
    <item>
      <title>Security in AppStudio Quick Report</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/security-in-appstudio-quick-report/m-p/770459#M443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm working with an app that I want the public to be able to edit through the app, but I do not want the public to be able to access the app through our organizations rest endpoint. I secured the feature service by going into ArcGIS Server Manager and limiting access to a role containing a single user.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From there it seems like there are two ways to add the user credentials to the app:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Embed &amp;nbsp;the username and password into this line in FeatureServiceManager.qml under the generateToken function&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="font-size: 11.5pt; color: olive; border: none windowtext 1.0pt; padding: 0in; background: white;"&gt;var&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM style="border: none windowtext 1.0pt; padding: 0in; color: #2985c7; background: white; font-size: 11.5pt;"&gt;obj&lt;/EM&gt;&lt;SPAN&gt;&lt;EM style="border: none windowtext 1.0pt; padding: 0in; color: #2985c7; background: white; font-size: 11.5pt;"&gt;&amp;nbsp;&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.5pt; color: #3d3d3d; background: white;"&gt;= {&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.5pt; color: green; border: none windowtext 1.0pt; padding: 0in; background: white;"&gt;"username"&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.5pt; color: #3d3d3d; background: white;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.5pt; color: green; border: none windowtext 1.0pt; padding: 0in; background: white;"&gt;"user"&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.5pt; color: #3d3d3d; background: white;"&gt;,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.5pt; color: green; border: none windowtext 1.0pt; padding: 0in; background: white;"&gt;"password"&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.5pt; color: #3d3d3d; background: white;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.5pt; color: green; border: none windowtext 1.0pt; padding: 0in; background: white;"&gt;"pwd"&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; background: white; font-size: 11.5pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.5pt; color: green; border: none windowtext 1.0pt; padding: 0in; background: white;"&gt;"f"&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.5pt; color: #3d3d3d; background: white;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.5pt; color: green; border: none windowtext 1.0pt; padding: 0in; background: white;"&gt;"json"&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.5pt; color: #3d3d3d; background: white;"&gt;, referer:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.5pt; color: green; border: none windowtext 1.0pt; padding: 0in; background: white;"&gt;"&lt;/SPAN&gt;&lt;A href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fwww.arcgis.com"&gt;&lt;SPAN style="font-size: 11.5pt; color: green; border: none windowtext 1.0pt; padding: 0in; background: white;"&gt;http://www.arcgis.com&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="font-size: 11.5pt; color: green; border: none windowtext 1.0pt; padding: 0in; background: white;"&gt;"/*, expiration:"1"*/&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.5pt; color: #3d3d3d; background: white;"&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2. OR&amp;nbsp;manually go to the token url, enter the username and password, generate a token, and hard code the token into the app at the top of FeatureServiceManager.qml (Hopefully this is the correct place. I haven't tested this)&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="font-size: 10.0pt; color: purple;"&gt;Item&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="font-size: 10.0pt; color: silver;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: maroon;"&gt;id&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;: &lt;EM style="color: black;"&gt;featureServiceManager&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="font-size: 10.0pt; color: silver;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: olive;"&gt;property&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; color: olive;"&gt;url&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; color: maroon;"&gt;url&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; color: olive;"&gt;property&lt;/SPAN&gt; &lt;SPAN style="font-size: 12.0pt; color: olive;"&gt;string&lt;/SPAN&gt; &lt;SPAN style="font-size: 12.0pt; color: maroon;"&gt;token&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;: &lt;SPAN style="color: green;"&gt;"wqFQ8vHYATcjDMrbuecyxmPX2R3R7UoTbQKvo5DBcFsAUdEmiT74f7c-ICYwxI0L"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My questions are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it safe to store username and password in the code for the app? Is there a way for the public to get to it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If so, is it safe to store the token in the app? If someone got the token, couldn't they plug it into the rest endpoint and get to the service that way?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;h&lt;/SPAN&gt;ttp://myserver/arcgis/rest/services?token=wqFQ8vHYATcjDMrbuecyxmPX2R3R7UoTbQKvo5DBcFsAUdEmiT74f7c-ICYwxI0L&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using AppStudio (Desktop 1.4) and the Quick Report template.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Apr 2017 22:05:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/security-in-appstudio-quick-report/m-p/770459#M443</guid>
      <dc:creator>KE</dc:creator>
      <dc:date>2017-04-06T22:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: Security in AppStudio Quick Report</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/security-in-appstudio-quick-report/m-p/770460#M444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let me answer your questions in order:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. It is never safe to store any type of credentials in any client side app. having said that since you are writing a native app and it gets compiled to binary it's not very easy to get to it but if you are very concerned then you should not go this route.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Saving token in the app will not help in two ways. First, it will expire at some time (or might change if you make any changes to the service) and second as you noted if you do manage to generate a long life token then it's as good as exposing username and password since it could be used to get access outside of the app.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: In general unless you use https all web traffic from your app can be intercepted irrespective of the method used. So to be safe it's a good idea to use SSL endpoints.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are two solutions in your case I can think of right now:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Use a server-side proxy. This proxy will be exposed as an URL but can be unlocked only by your app (you can use many techniques like salt, authenticated headers etc...) and will allow the requests to pass through to get back a short-lived token. Then the app uses this token to continue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Use app level oAuth (not user level). Read this for more info:&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/authentication/#app-login" title="https://developers.arcgis.com/authentication/#app-login"&gt;ArcGIS Security and Authentication | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;-Sathya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Apr 2017 22:39:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/security-in-appstudio-quick-report/m-p/770460#M444</guid>
      <dc:creator>SathyaPrasad</dc:creator>
      <dc:date>2017-04-06T22:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: Security in AppStudio Quick Report</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/security-in-appstudio-quick-report/m-p/770461#M445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Clarification: I was testing with an http connection but the app will use https.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don’t think solution 2 will work because my service is located on our ArcGIS Server. Also it said a limitation was that the tokens are read only and my users need to edit the feature service.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to figure out how to implement solution 1, I found these directions here &lt;A href="https://developers.arcgis.com/javascript/3/jshelp/ags_proxy.html"&gt;https://developers.arcgis.com/javascript/3/jshelp/ags_proxy.html&lt;/A&gt;&lt;SPAN&gt;. I was able to download the github file and set up the configuration on our webserver (DotNet version: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fgithub.com%2FEsri%2Fresource-proxy%2Ftree%2Fmaster%2FDotNet" rel="nofollow" target="_blank"&gt;https://github.com/Esri/resource-proxy/tree/master/DotNet&lt;/A&gt;&lt;SPAN&gt;). But it looks like I need to setup a proxy rule within the code for my app to tell it to use the proxy. Do I need to&amp;nbsp;add a JavaScript file to my app and use urlUtils.addProxyRule? Or is there qml code that does something similar?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wasn’t able to find any information on salt or authenticated headers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Apr 2017 14:52:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/security-in-appstudio-quick-report/m-p/770461#M445</guid>
      <dc:creator>KE</dc:creator>
      <dc:date>2017-04-12T14:52:41Z</dc:date>
    </item>
  </channel>
</rss>

