<?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 how to authenticate with token only to get a route with routeTask.createFromToken(&amp;quot;x&amp;quot;)? in Kotlin Maps SDK Questions</title>
    <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-to-authenticate-with-token-only-to-get-a-route/m-p/1289552#M54</link>
    <description>&lt;P&gt;I'm trying to get a route with Arcgis routeTask adding the token obtained from the service but it doesn't work correctly, sometimes it succeeds in authenticating and other times it doesn't, could you please help me?&lt;/P&gt;&lt;P&gt;I am using the java sdk..&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var credential: UserCredential = UserCredential.createFromToken(arcgisToken,"www.arcgis.com")
  
fun solveRoute(){
   val rouTask = RouteTask(appContext,"https://route- 
   api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World")
   rouTask.credential = credential          
   AuthenticationManager.setAuthenticationChallengeHandler(this)
   rouTask.loadAsync()
   rouTask.addDoneLoadingListener {
   //
   }
}
override fun handleChallenge(p0: AuthenticationChallenge?): AuthenticationChallengeResponse {
        return AuthenticationChallengeResponse(
            AuthenticationChallengeResponse.Action.CONTINUE_WITH_CREDENTIAL,
            credential
        )
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 16 May 2023 13:01:07 GMT</pubDate>
    <dc:creator>JhostinLunaLunaHuanca</dc:creator>
    <dc:date>2023-05-16T13:01:07Z</dc:date>
    <item>
      <title>how to authenticate with token only to get a route with routeTask.createFromToken("x")?</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-to-authenticate-with-token-only-to-get-a-route/m-p/1289552#M54</link>
      <description>&lt;P&gt;I'm trying to get a route with Arcgis routeTask adding the token obtained from the service but it doesn't work correctly, sometimes it succeeds in authenticating and other times it doesn't, could you please help me?&lt;/P&gt;&lt;P&gt;I am using the java sdk..&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var credential: UserCredential = UserCredential.createFromToken(arcgisToken,"www.arcgis.com")
  
fun solveRoute(){
   val rouTask = RouteTask(appContext,"https://route- 
   api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World")
   rouTask.credential = credential          
   AuthenticationManager.setAuthenticationChallengeHandler(this)
   rouTask.loadAsync()
   rouTask.addDoneLoadingListener {
   //
   }
}
override fun handleChallenge(p0: AuthenticationChallenge?): AuthenticationChallengeResponse {
        return AuthenticationChallengeResponse(
            AuthenticationChallengeResponse.Action.CONTINUE_WITH_CREDENTIAL,
            credential
        )
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 13:01:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-to-authenticate-with-token-only-to-get-a-route/m-p/1289552#M54</guid>
      <dc:creator>JhostinLunaLunaHuanca</dc:creator>
      <dc:date>2023-05-16T13:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: how to authenticate with token only to get a route with routeTask.createFromToken("x")?</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-to-authenticate-with-token-only-to-get-a-route/m-p/1294542#M55</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks like you are working with the ArcGIS Runtime API for Android or ArcGIS Maps SDK for Kotlin here. I'll move your post to that forum (this particular forum is for the Java Maps SDK to build apps for Windows, Linux and macOS platforms).&lt;/P&gt;&lt;P&gt;In the meanwhile, you might find it helpful to have a look at the &lt;A href="https://developers.arcgis.com/android/java/sample-code/find-route/" target="_self"&gt;Find Route sample&lt;/A&gt; on the Android-Java samples webpage, or the same sample on the &lt;A href="https://developers.arcgis.com/kotlin/sample-code/find-route/" target="_self"&gt;Kotlin sample code page&lt;/A&gt;. The sample shows how to set up a route task. For authentication challenges, have a look at the Cloud and Portal section on the &lt;A href="https://developers.arcgis.com/kotlin/sample-code/" target="_self"&gt;Sample Code homepage&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 15:42:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-to-authenticate-with-token-only-to-get-a-route/m-p/1294542#M55</guid>
      <dc:creator>Rachael_Ellen</dc:creator>
      <dc:date>2023-05-31T15:42:19Z</dc:date>
    </item>
  </channel>
</rss>

