<?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: HELP - [AGSFeatureLayer addFeatures] doesn't use token authentication in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/help-agsfeaturelayer-addfeatures-doesn-t-use-token/m-p/390888#M3370</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for reporting, we'll look into this.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Apr 2011 06:09:20 GMT</pubDate>
    <dc:creator>DiveshGoyal</dc:creator>
    <dc:date>2011-04-18T06:09:20Z</dc:date>
    <item>
      <title>HELP - [AGSFeatureLayer addFeatures] doesn't use token authentication</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/help-agsfeaturelayer-addfeatures-doesn-t-use-token/m-p/390887#M3369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm accessing a secured ArcGIS feature layer.&amp;nbsp; The feature layer definitely works, because I can access and display its features.&amp;nbsp; I create the feature layer like so:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;NSURL *featureURL = [NSURL URLWithString:@"http://server/ArcGIS/rest/services/SeMAPS-GEO/FeatureServer/0"];
&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSCredential *myCredential = [[[AGSCredential alloc] initWithUser:@"username" password:@"password" authenticationType:AGSAuthenticationTypeToken tokenUrl:[NSURL URLWithString:@"http://server/ArcGIS/tokens"]] autorelease];
&amp;nbsp;&amp;nbsp;&amp;nbsp; featureLayer= [AGSFeatureLayer featureServiceLayerWithURL:featureURL mode:AGSFeatureLayerModeOnDemand credential:myCredential];&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And I can view the features on an AGSMapView, etc., and authentication is working.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem comes when it's time to add a new feature:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;featureLayer.editingDelegate = self;
&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSFeatureTemplate *template = [[featureLayer templates] objectAtIndex:0];
&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSGraphic *feature = [featureLayer createFeatureWithTemplate:template];
&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSMutablePolygon *poly = [[[AGSMutablePolygon alloc] initWithSpatialReference:[AGSSpatialReference spatialReferenceWithWKID:3857]] autorelease];
&amp;nbsp;&amp;nbsp;&amp;nbsp; [poly addRingToPolygon];
&amp;nbsp;&amp;nbsp;&amp;nbsp; [poly addPointToRing:[mapView toMapPoint:CGPointMake(0, 0)]];
&amp;nbsp;&amp;nbsp;&amp;nbsp; [poly addPointToRing:[mapView toMapPoint:CGPointMake(0,50)]];
&amp;nbsp;&amp;nbsp;&amp;nbsp; [poly addPointToRing:[mapView toMapPoint:CGPointMake(100, 100)]];
&amp;nbsp;&amp;nbsp;&amp;nbsp; feature.geometry = poly;
&amp;nbsp;&amp;nbsp;&amp;nbsp; [featureLayer addFeatures:[NSArray arrayWithObject:feature]];&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This returns back an "Unauthorized access."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A little WireShark sniffing shows this as what's being sent to the server:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;f=json&amp;amp;features=[{"geometry":{"spatialReference":{"wkid":3857},"rings":[[[-10550558,3831481.531450578],[-10550558,3831394.240051348],[-10550383.41720154,3831306.948652118]]]},"attributes":{"perimeter":null,"n_dpoints":null,"centerlong":null,"volume":null,"dateupdated":null,"size":null,"projectid":null,"meandepth":null,"datecreated":null,"maxdepth":null,"wateruse":null,"waterlevel":null,"centerlat":null,"name":null}}]&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Notice what's missing?&amp;nbsp; No token!&amp;nbsp; Well obviously without a token it's going to be unauthorized access!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How do I get the addFeatures method to use a token for authentication?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2011 05:00:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/help-agsfeaturelayer-addfeatures-doesn-t-use-token/m-p/390887#M3369</guid>
      <dc:creator>DrewCrawford</dc:creator>
      <dc:date>2011-04-18T05:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: HELP - [AGSFeatureLayer addFeatures] doesn't use token authentication</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/help-agsfeaturelayer-addfeatures-doesn-t-use-token/m-p/390888#M3370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for reporting, we'll look into this.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2011 06:09:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/help-agsfeaturelayer-addfeatures-doesn-t-use-token/m-p/390888#M3370</guid>
      <dc:creator>DiveshGoyal</dc:creator>
      <dc:date>2011-04-18T06:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: HELP - [AGSFeatureLayer addFeatures] doesn't use token authentication</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/help-agsfeaturelayer-addfeatures-doesn-t-use-token/m-p/390889#M3371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is indeed an issue. It will be fixed in the next release of the API which is due out shortly.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Apr 2011 17:30:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/help-agsfeaturelayer-addfeatures-doesn-t-use-token/m-p/390889#M3371</guid>
      <dc:creator>DiveshGoyal</dc:creator>
      <dc:date>2011-04-19T17:30:33Z</dc:date>
    </item>
  </channel>
</rss>

