<?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 Secure Services in SDK in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-secure-services-in-sdk/m-p/619781#M4265</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, this is supported in the SDK.&amp;nbsp; To use a service that requires tokens, you must first obtain a token, and then embed the token in your application.&amp;nbsp; Once you have a valid token you can add it to your application code using the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;ArcGISFeaturelayer&lt;/SPAN&gt;&lt;SPAN&gt; constructor. In order to create a token based secure layer you must construct a &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;UserCredential&lt;/SPAN&gt;&lt;SPAN&gt; with a token and pass it into the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;ArcGISFeaturelayer&lt;/SPAN&gt;&lt;SPAN&gt; constructor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
UserCredentials credentials =new UserCredentials();
credentials.setUserToken("&lt;STRONG&gt;PLACE_YOUR_TOKEN_HERE&lt;/STRONG&gt;", "&lt;STRONG&gt;URL_REFERRER&lt;/STRONG&gt;");
tokenLayer = new ArcGISFeatureLayer("&lt;STRONG&gt;SECURE FEATURE SERVICE URL&lt;/STRONG&gt;", MODE.SNAPSHOT, credentials);
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Replacing &lt;/SPAN&gt;&lt;STRONG&gt;BOLD&lt;/STRONG&gt;&lt;SPAN&gt; text with appropriate parameters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The same philosophy applies to WebMap. Do not put a token based URL as your web map layer�??s URL. The correct way to include a secure layer in webmap.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1. Include the layer�??s URL without a token&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2. If layer initialization fails and it is a security exception, ask for user�??s credential&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3.&amp;nbsp; Re-initialize the layer with user credential.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 02:27:58 GMT</pubDate>
    <dc:creator>DanO_Neill</dc:creator>
    <dc:date>2021-12-12T02:27:58Z</dc:date>
    <item>
      <title>Using Secure Services in SDK</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-secure-services-in-sdk/m-p/619780#M4264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am developing an app that uses a secured map service.&amp;nbsp; I have read about using the UserCredentials class to specify a user name and password.&amp;nbsp; However, when I try to add the secure service, the service is failing to initialize.&amp;nbsp; I have read that the ArcGIS for Android app does not support secure services yet, does the SDK not either?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jan 2012 15:55:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-secure-services-in-sdk/m-p/619780#M4264</guid>
      <dc:creator>JustinGreco</dc:creator>
      <dc:date>2012-01-25T15:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: Using Secure Services in SDK</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-secure-services-in-sdk/m-p/619781#M4265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, this is supported in the SDK.&amp;nbsp; To use a service that requires tokens, you must first obtain a token, and then embed the token in your application.&amp;nbsp; Once you have a valid token you can add it to your application code using the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;ArcGISFeaturelayer&lt;/SPAN&gt;&lt;SPAN&gt; constructor. In order to create a token based secure layer you must construct a &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;UserCredential&lt;/SPAN&gt;&lt;SPAN&gt; with a token and pass it into the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;ArcGISFeaturelayer&lt;/SPAN&gt;&lt;SPAN&gt; constructor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
UserCredentials credentials =new UserCredentials();
credentials.setUserToken("&lt;STRONG&gt;PLACE_YOUR_TOKEN_HERE&lt;/STRONG&gt;", "&lt;STRONG&gt;URL_REFERRER&lt;/STRONG&gt;");
tokenLayer = new ArcGISFeatureLayer("&lt;STRONG&gt;SECURE FEATURE SERVICE URL&lt;/STRONG&gt;", MODE.SNAPSHOT, credentials);
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Replacing &lt;/SPAN&gt;&lt;STRONG&gt;BOLD&lt;/STRONG&gt;&lt;SPAN&gt; text with appropriate parameters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The same philosophy applies to WebMap. Do not put a token based URL as your web map layer�??s URL. The correct way to include a secure layer in webmap.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1. Include the layer�??s URL without a token&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2. If layer initialization fails and it is a security exception, ask for user�??s credential&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3.&amp;nbsp; Re-initialize the layer with user credential.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:27:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-secure-services-in-sdk/m-p/619781#M4265</guid>
      <dc:creator>DanO_Neill</dc:creator>
      <dc:date>2021-12-12T02:27:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using Secure Services in SDK</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-secure-services-in-sdk/m-p/619782#M4266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the response.&amp;nbsp; I had the code correct, but the issue was with how I had the security set up in ArcGIS Server.&amp;nbsp; I got that resolved and the feature layer is drawing.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2012 11:44:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-secure-services-in-sdk/m-p/619782#M4266</guid>
      <dc:creator>JustinGreco</dc:creator>
      <dc:date>2012-01-26T11:44:42Z</dc:date>
    </item>
  </channel>
</rss>

