<?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 Current replacement for EsriSecurityException in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/current-replacement-for-esrisecurityexception/m-p/743777#M5229</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We are having to migrate an existing app from 10.2.9 to 100.6 for Google's new 64bit compatibility requirement.&lt;/P&gt;&lt;P&gt;We have most of the app converted apart from one section concerning authentication handling.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In 10.2.9 we were able to get detailed errors from a failed login using EsriSecurityException but we have been unable to find any replacement that gives us the same level of error detail.&amp;nbsp; Errors generated via the new AuthenticationManager are just a generic response stating that we do not have access to the resource, &amp;nbsp;without giving an underlying cause, such as "Invalid username or password".&lt;/P&gt;&lt;P&gt;I have trawled through all the documentation and can find nothing concerning this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anybody tried this and managed to get detailed responses?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Sep 2019 11:33:44 GMT</pubDate>
    <dc:creator>SimonTrice</dc:creator>
    <dc:date>2019-09-23T11:33:44Z</dc:date>
    <item>
      <title>Current replacement for EsriSecurityException</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/current-replacement-for-esrisecurityexception/m-p/743777#M5229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We are having to migrate an existing app from 10.2.9 to 100.6 for Google's new 64bit compatibility requirement.&lt;/P&gt;&lt;P&gt;We have most of the app converted apart from one section concerning authentication handling.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In 10.2.9 we were able to get detailed errors from a failed login using EsriSecurityException but we have been unable to find any replacement that gives us the same level of error detail.&amp;nbsp; Errors generated via the new AuthenticationManager are just a generic response stating that we do not have access to the resource, &amp;nbsp;without giving an underlying cause, such as "Invalid username or password".&lt;/P&gt;&lt;P&gt;I have trawled through all the documentation and can find nothing concerning this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anybody tried this and managed to get detailed responses?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Sep 2019 11:33:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/current-replacement-for-esrisecurityexception/m-p/743777#M5229</guid>
      <dc:creator>SimonTrice</dc:creator>
      <dc:date>2019-09-23T11:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: Current replacement for EsriSecurityException</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/current-replacement-for-esrisecurityexception/m-p/743778#M5230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Simon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for lacking of appropriate documentation concerning dealing with authentication errors. We have created issues and will endeavor to improve&amp;nbsp;our documentation in future releases.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Starting from 100.0, errors thrown from our SDK are wrapped in a class called ArcGISRuntimeException.&amp;nbsp;&lt;SPAN style="color: #474747; background-color: #ffffff;"&gt;More specific information of where the error occurred and what caused it are provided via&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;CODE&gt;&lt;A href="https://developers.arcgis.com/android/latest/api-reference/reference/com/esri/arcgisruntime/ArcGISRuntimeException.html#getErrorDomain()" style="color: #4a6782; background-color: #ffffff; text-decoration: none;" rel="nofollow noopener noreferrer" target="_blank"&gt;getErrorDomain()&lt;/A&gt;,&lt;/CODE&gt;&lt;SPAN style="color: #474747; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;CODE&gt;&lt;A href="https://developers.arcgis.com/android/latest/api-reference/reference/com/esri/arcgisruntime/ArcGISRuntimeException.html#getErrorCode()" style="color: #bb7a2a; background-color: #ffffff; text-decoration: none;" rel="nofollow noopener noreferrer" target="_blank"&gt;getErrorCode()&lt;/A&gt;&lt;/CODE&gt;&lt;SPAN style="color: #474747; background-color: #ffffff;"&gt;&amp;nbsp;and&amp;nbsp;&lt;A href="https://developers.arcgis.com/android/latest/api-reference/reference/com/esri/arcgisruntime/ArcGISRuntimeException.html#getCause()" rel="nofollow noopener noreferrer" target="_blank"&gt;getCause()&lt;/A&gt;.&amp;nbsp;In&amp;nbsp;regard to&amp;nbsp;obtaining detailed error message when an authentication fails, you can work with&amp;nbsp;&lt;SPAN style="color: #3d3d3d;"&gt;ArcGISRuntimeException&amp;nbsp;in the similar way as&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;EsriSecurityException as shown in the following code snippet:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;    Throwable cause &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; error&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getCause&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="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;cause &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; null&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
      Log&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;i&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tag&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"error without a cause - code: "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; error&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getErrorCode&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"; "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; error&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getMessage&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="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
      &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;cause &lt;SPAN class="keyword token"&gt;instanceof&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;JsonEmbeddedException&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
        JsonEmbeddedException jsonError &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;JsonEmbeddedException&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; cause&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        Log&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;i&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tag&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"error with cause: JsonEmbeddedException - code: "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; jsonError&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getCode&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
            &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" message: "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; jsonError&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getMessage&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="punctuation token"&gt;;&lt;/SPAN&gt;
      &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
        Log&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;i&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tag&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"error with cause: "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; cause&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getClass&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="token function"&gt;getSimpleName&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" - code: "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; error&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getErrorCode&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
            &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" message: "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; cause&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getMessage&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="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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The followings are some example printout from the above code snippet in some error cases:&lt;/P&gt;&lt;P&gt;1. Passing wrong credential to a token-based portal/layer&lt;/P&gt;&lt;P&gt;error with cause: JsonEmbeddedException - code: 400 message: Unable to generate token.&lt;/P&gt;&lt;P&gt;2. Passing&amp;nbsp;&lt;SPAN&gt;wrong credential to aN IWA portal/layer&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;error with cause: HttpResponseException - code: 22 message: status code: 401, reason phrase: Unauthorized: Access is denied due to invalid credentials.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please share more info regarding your workflow if you still have problem in handling error message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:39:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/current-replacement-for-esrisecurityexception/m-p/743778#M5230</guid>
      <dc:creator>XuemingWu</dc:creator>
      <dc:date>2021-12-12T07:39:11Z</dc:date>
    </item>
  </channel>
</rss>

