<?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: Authenticating directly on a service in Swift Maps SDK Questions</title>
    <link>https://community.esri.com/t5/swift-maps-sdk-questions/authenticating-directly-on-a-service/m-p/1313511#M108</link>
    <description>&lt;P&gt;Perfect, this was just what I needed! Absolutely brilliant &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 31 Jul 2023 06:50:42 GMT</pubDate>
    <dc:creator>frankm</dc:creator>
    <dc:date>2023-07-31T06:50:42Z</dc:date>
    <item>
      <title>Authenticating directly on a service</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/authenticating-directly-on-a-service/m-p/1313027#M106</link>
      <description>&lt;P&gt;So, I am doing some digging into an older app using the runtime sdk, and was trying to reproduce some functionality using the Maps SDK.&lt;/P&gt;&lt;P&gt;In the old app, they are creating a service feature table, authenticating and then performing a query, something like this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="swift"&gt;someService = AGSServiceFeatureTable(&amp;lt;with an url&amp;gt;)

// then setting credentials (to be used only with the service)

someService?.credential = AGSCredential(
    user: environment.portal.username,
    password: environment.portal.password
)

// some more code, setting featureRequestMode, etc
// then perform a queryFeatures on the service&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, in the new SDK, I think the equivalent service is the&amp;nbsp;ServiceFeatureTable? But, I cannot set the credentials the same way. I am of course getting an error message indicating missing credentials.&lt;BR /&gt;&lt;BR /&gt;My question is, is it possible, and if, how would I do this?&lt;BR /&gt;&lt;BR /&gt;The problem is that I am to actually authenticate to a different service for other functionality, and this is a secondary "helper" service, and not really connectable with the other one, so it would be great to be able to fire up a authenticated connection on-the-fly.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2023 12:11:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/authenticating-directly-on-a-service/m-p/1313027#M106</guid>
      <dc:creator>frankm</dc:creator>
      <dc:date>2023-07-28T12:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: Authenticating directly on a service</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/authenticating-directly-on-a-service/m-p/1313108#M107</link>
      <description>&lt;P&gt;Hi Frank,&lt;/P&gt;&lt;P&gt;Like 100.x SDK, the credential property is not available in 200.x SDK. Please refer the&amp;nbsp;&lt;A href="https://developers.arcgis.com/swift/reference/migrate-authentication-100-x-to-200-x/" target="_self"&gt;&lt;SPAN&gt;Migrate authentication from 100.x to 200.x&amp;nbsp;&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp;doc for all the differences.&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can create the credential and add it to the store before creating and loading the service feature table.&lt;/P&gt;&lt;LI-CODE lang="swift"&gt;        let tokenCredential = try await TokenCredential.credential(
            for: URL(string: "&amp;lt;service feature table url&amp;gt;")!,
            username: "username",
            password: "password"
        )
        ArcGISEnvironment.authenticationManager.arcGISCredentialStore.add(tokenCredential)

        let table = ServiceFeatureTable(url: URL(string: "&amp;lt;service feature table url&amp;gt;")!)
        try await table.load()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nimesh&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2023 15:07:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/authenticating-directly-on-a-service/m-p/1313108#M107</guid>
      <dc:creator>NimeshJarecha</dc:creator>
      <dc:date>2023-07-28T15:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: Authenticating directly on a service</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/authenticating-directly-on-a-service/m-p/1313511#M108</link>
      <description>&lt;P&gt;Perfect, this was just what I needed! Absolutely brilliant &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2023 06:50:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/authenticating-directly-on-a-service/m-p/1313511#M108</guid>
      <dc:creator>frankm</dc:creator>
      <dc:date>2023-07-31T06:50:42Z</dc:date>
    </item>
  </channel>
</rss>

