<?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: What message does IdentityManager provide for insufficient access? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-message-does-identitymanager-provide-for/m-p/643647#M60044</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply. I think the second method makes more sense as I understand OAuth is designed for ArcGIS online users(?). It would make more sense if the IdentityManager had a method [e.g. Boolean&amp;nbsp;hasAccess(userId, url)] to return info on access to certain services.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Aug 2017 17:47:50 GMT</pubDate>
    <dc:creator>NaciDilekli</dc:creator>
    <dc:date>2017-08-15T17:47:50Z</dc:date>
    <item>
      <title>What message does IdentityManager provide for insufficient access?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-message-does-identitymanager-provide-for/m-p/643645#M60042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two types of users in my ArcGIS server user base; mappers and editors. As you can imagine only editors can view and edit the FeatureLayers. I see a strange behavior, though. When prompted for login at a site with secured services, a mapper can enter his/her credentials, without any problems at the login screen. Mapper user won't be able to see the featurelayers, but the server won't generate any errors either.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I thought I could manually create an alert or something, based on the successful / failed authorization. For that, I looked at what&amp;nbsp;IdentityManager generates for the mapper vs editor users. The results look identical. For both of them, findCredential method (with userId and secured service URL as parameters) return this credential object:&lt;/P&gt;&lt;OL class="" style="color: #212121; padding-left: 12px;"&gt;&lt;LI&gt;&lt;SPAN class="" style="color: #881391;"&gt;creationTime&lt;/SPAN&gt;&lt;SPAN class="" style="padding-right: 5px;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #1c00cf;"&gt;1502747512054&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="" style="color: #881391;"&gt;expires&lt;/SPAN&gt;&lt;SPAN class="" style="padding-right: 5px;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #1c00cf;"&gt;1502751112194&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="" style="color: #881391;"&gt;isAdmin&lt;/SPAN&gt;&lt;SPAN class="" style="padding-right: 5px;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #808080;"&gt;undefined&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class=""&gt;&lt;SPAN class="" style="color: #881391;"&gt;resources&lt;/SPAN&gt;&lt;SPAN class="" style="padding-right: 5px;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: inherit;"&gt;&lt;SPAN class="" style="font-size: 12px !important;"&gt;[&lt;SPAN class="" style="color: #c41a16;"&gt;"some&amp;nbsp;service"&lt;/SPAN&gt;]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="" style="color: #881391;"&gt;scope&lt;/SPAN&gt;&lt;SPAN class="" style="padding-right: 5px;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #c41a16;"&gt;&lt;SPAN class="" style="color: #222222;"&gt;"&lt;/SPAN&gt;server&lt;SPAN class="" style="color: #222222;"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="" style="color: #881391;"&gt;server&lt;/SPAN&gt;&lt;SPAN class="" style="padding-right: 5px;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #c41a16;"&gt;&lt;SPAN class="" style="color: #222222;"&gt;"some server&lt;/SPAN&gt;&lt;SPAN class="" style="color: #222222;"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="" style="color: #881391;"&gt;ssl&lt;/SPAN&gt;&lt;SPAN class="" style="padding-right: 5px;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0d22aa;"&gt;false&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="" style="color: #881391;"&gt;token&lt;/SPAN&gt;&lt;SPAN class="" style="padding-right: 5px;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #c41a16;"&gt;&lt;SPAN class="" style="color: #222222;"&gt;"&lt;/SPAN&gt;IcXTutjVEYmbP7LuYKqmO-wDyUx56vW5xjbN8LrENGo.&lt;SPAN class="" style="color: #222222;"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="" style="color: #881391;"&gt;userId&lt;/SPAN&gt;&lt;SPAN class="" style="padding-right: 5px;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #c41a16;"&gt;&lt;SPAN class="" style="color: #222222;"&gt;"some&lt;/SPAN&gt;Mapper/Editor&lt;SPAN class="" style="color: #222222;"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="" style="color: #881391;"&gt;validity&lt;/SPAN&gt;&lt;SPAN class="" style="padding-right: 5px;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #1c00cf;"&gt;60&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, how come the server generates a token with validity for a mapper user, while that user can't view that resource?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Secondly, how can I programmatically tell if a user has or doesn't have access to some resource?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Aug 2017 22:04:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-message-does-identitymanager-provide-for/m-p/643645#M60042</guid>
      <dc:creator>NaciDilekli</dc:creator>
      <dc:date>2017-08-14T22:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: What message does IdentityManager provide for insufficient access?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-message-does-identitymanager-provide-for/m-p/643646#M60043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Token are not generated per resource, just per user. &amp;nbsp;So a mapper is generating a token the same way an editor is, their token will just not be accepted when they try to access a resource they don't have permission to view.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure the best way for you to handle this, but you may want to have users &lt;A href="https://developers.arcgis.com/javascript/3/jssamples/portal_oauth_inline.html"&gt;login using OAuth&lt;/A&gt;&amp;nbsp;(that's 3.XX). &amp;nbsp;Once the user has logged in, you'll have &lt;A href="https://developers.arcgis.com/javascript/3/jsapi/portaluser-amd.html"&gt;PortalUser&lt;/A&gt; object, which has information about that user's role and privileges. &amp;nbsp;You could check this object and show a warning.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another option is just to add a catch to the code that adds the layers in question. &amp;nbsp;When a tries to view a layer, a request is made to the server for the layer information. &amp;nbsp;If the user doesn't have permission, an error is thrown from within the asynchronous request code. &amp;nbsp;You can tap into this error by adding a .catch(err =&amp;gt; &amp;lt;show error dialogue&amp;gt;) to the asynchronous code that is loading the layer(s). &amp;nbsp;It's hard for me to say more without knowing how layers are being added/other specific details about your application.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Aug 2017 13:59:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-message-does-identitymanager-provide-for/m-p/643646#M60043</guid>
      <dc:creator>ThomasSolow</dc:creator>
      <dc:date>2017-08-15T13:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: What message does IdentityManager provide for insufficient access?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-message-does-identitymanager-provide-for/m-p/643647#M60044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply. I think the second method makes more sense as I understand OAuth is designed for ArcGIS online users(?). It would make more sense if the IdentityManager had a method [e.g. Boolean&amp;nbsp;hasAccess(userId, url)] to return info on access to certain services.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Aug 2017 17:47:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-message-does-identitymanager-provide-for/m-p/643647#M60044</guid>
      <dc:creator>NaciDilekli</dc:creator>
      <dc:date>2017-08-15T17:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: What message does IdentityManager provide for insufficient access?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-message-does-identitymanager-provide-for/m-p/643648#M60045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OAuth works fine for AGOL users or Portal users.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I agree that that&amp;nbsp;would be a nice convenience method. &amp;nbsp;You could write it yourself though, something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;checkUserPermissions&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;token&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; featureLayerURL&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;esriRequest&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;featureLayerURL&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; query&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; token&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; token&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'json'&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;then&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;true&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;otherwise&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;err &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;false&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:21:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-message-does-identitymanager-provide-for/m-p/643648#M60045</guid>
      <dc:creator>ThomasSolow</dc:creator>
      <dc:date>2021-12-12T03:21:20Z</dc:date>
    </item>
  </channel>
</rss>

