<?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 World Traffic Service failed to render due to Authentication issue. in Kotlin Maps SDK Questions</title>
    <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/world-traffic-service-failed-to-render-due-to/m-p/1678603#M631</link>
    <description>&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;We are using Kotlin Maps SDK (&lt;STRONG&gt;version : 200.8.0&lt;/STRONG&gt;) in our Android App to display maps.&lt;/P&gt;&lt;P&gt;Our QA backend release new URL to display traffic heat layer.&lt;BR /&gt;URL :&amp;nbsp;&lt;A href="https://traffic.arcgis.com/arcgis/rest/services/World/Traffic/MapServer" target="_blank" rel="noopener"&gt;https://traffic.arcgis.com/arcgis/rest/services/World/Traffic/MapServer&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Whenever app tries to load traffic layer using this url the SDK throws following error.&lt;BR /&gt;&lt;STRONG&gt;An ArcGIS authentication error occurred when accessing &lt;A href="https://www.arcgis.com" target="_blank" rel="noopener"&gt;https://www.arcgis.com&lt;/A&gt;. An API key or credential may be required. For more information see &lt;A href="https://developers.arcgis.com/kotlin/security-and-authentication/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/kotlin/security-and-authentication/&lt;/A&gt;.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;Following is my code to render traffic layer in Kotlin.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;fun getT&lt;/SPAN&gt;&lt;SPAN&gt;rafficLayer&lt;/SPAN&gt;(accessToken: String): BasemapResult.AsLayer {&lt;BR /&gt;    ArcGISEnvironment.&lt;SPAN&gt;apiKey &lt;/SPAN&gt;= ApiKey.create(accessToken)&lt;BR /&gt;    &lt;SPAN&gt;val &lt;/SPAN&gt;newLayer = ArcGISMapImageLayer(&lt;SPAN&gt;"https://traffic.arcgis.com/arcgis/rest/services/World/Traffic/MapServer/"&lt;/SPAN&gt;)&lt;BR /&gt;    newLayer.&lt;SPAN&gt;name &lt;/SPAN&gt;= &lt;SPAN&gt;"Traffic Layer"&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;return &lt;/SPAN&gt;BasemapResult.AsLayer(newLayer)&lt;BR /&gt;}&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;I am getting accessToken from backend.&lt;BR /&gt;&lt;BR /&gt;although other layers (vector,satellite) able to load successfully with same API Key.&lt;BR /&gt;&lt;BR /&gt;I tried to load this traffic URL on web with access token and few other parameter and worked successfully.&lt;BR /&gt;e.g. :&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://traffic.arcgis.com/arcgis/rest/services/World/Traffic/MapServer/export?bbox=2969828.768378092%2C-3115102.2103630807%2C2984695.7703795386%2C-3098763.7955671465&amp;amp;bboxSR=102100&amp;amp;imageSR=102100&amp;amp;size=778%2C855&amp;amp;dpi=96&amp;amp;format=png32&amp;amp;transparent=true&amp;amp;layers=show%3A4%2C51%2C7%2C12%2C54%2C15%2C20%2C57%2C23%2C28%2C60%2C31%2C48%2C63%2C43&amp;amp;f=image&amp;amp;token=ABC123" target="_blank" rel="noopener"&gt;https://traffic.arcgis.com/arcgis/rest/services/World/Traffic/MapServer/export?bbox=2969828.768378092%2C-3115102.2103630807%2C2984695.7703795386%2C-3098763.7955671465&amp;amp;bboxSR=102100&amp;amp;imageSR=102100&amp;amp;size=778%2C855&amp;amp;dpi=96&amp;amp;format=png32&amp;amp;transparent=true&amp;amp;layers=show%3A4%2C51%2C7%2C12%2C54%2C15%2C20%2C57%2C23%2C28%2C60%2C31%2C48%2C63%2C43&amp;amp;f=image&amp;amp;token=ABC123&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;It means there is no issue with access token.&lt;BR /&gt;&lt;/SPAN&gt;I dont know why it is failing to authenticate on Mobile only.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Is this an API Key issue ? Does traffic service needs to be enabled for this particular API Key / Account ?&lt;BR /&gt;&lt;BR /&gt;Please help me resolved this issue.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Prashant&lt;/P&gt;</description>
    <pubDate>Mon, 19 Jan 2026 13:07:46 GMT</pubDate>
    <dc:creator>PrashantGaykar</dc:creator>
    <dc:date>2026-01-19T13:07:46Z</dc:date>
    <item>
      <title>World Traffic Service failed to render due to Authentication issue.</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/world-traffic-service-failed-to-render-due-to/m-p/1678603#M631</link>
      <description>&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;We are using Kotlin Maps SDK (&lt;STRONG&gt;version : 200.8.0&lt;/STRONG&gt;) in our Android App to display maps.&lt;/P&gt;&lt;P&gt;Our QA backend release new URL to display traffic heat layer.&lt;BR /&gt;URL :&amp;nbsp;&lt;A href="https://traffic.arcgis.com/arcgis/rest/services/World/Traffic/MapServer" target="_blank" rel="noopener"&gt;https://traffic.arcgis.com/arcgis/rest/services/World/Traffic/MapServer&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Whenever app tries to load traffic layer using this url the SDK throws following error.&lt;BR /&gt;&lt;STRONG&gt;An ArcGIS authentication error occurred when accessing &lt;A href="https://www.arcgis.com" target="_blank" rel="noopener"&gt;https://www.arcgis.com&lt;/A&gt;. An API key or credential may be required. For more information see &lt;A href="https://developers.arcgis.com/kotlin/security-and-authentication/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/kotlin/security-and-authentication/&lt;/A&gt;.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;Following is my code to render traffic layer in Kotlin.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;fun getT&lt;/SPAN&gt;&lt;SPAN&gt;rafficLayer&lt;/SPAN&gt;(accessToken: String): BasemapResult.AsLayer {&lt;BR /&gt;    ArcGISEnvironment.&lt;SPAN&gt;apiKey &lt;/SPAN&gt;= ApiKey.create(accessToken)&lt;BR /&gt;    &lt;SPAN&gt;val &lt;/SPAN&gt;newLayer = ArcGISMapImageLayer(&lt;SPAN&gt;"https://traffic.arcgis.com/arcgis/rest/services/World/Traffic/MapServer/"&lt;/SPAN&gt;)&lt;BR /&gt;    newLayer.&lt;SPAN&gt;name &lt;/SPAN&gt;= &lt;SPAN&gt;"Traffic Layer"&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;return &lt;/SPAN&gt;BasemapResult.AsLayer(newLayer)&lt;BR /&gt;}&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;I am getting accessToken from backend.&lt;BR /&gt;&lt;BR /&gt;although other layers (vector,satellite) able to load successfully with same API Key.&lt;BR /&gt;&lt;BR /&gt;I tried to load this traffic URL on web with access token and few other parameter and worked successfully.&lt;BR /&gt;e.g. :&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://traffic.arcgis.com/arcgis/rest/services/World/Traffic/MapServer/export?bbox=2969828.768378092%2C-3115102.2103630807%2C2984695.7703795386%2C-3098763.7955671465&amp;amp;bboxSR=102100&amp;amp;imageSR=102100&amp;amp;size=778%2C855&amp;amp;dpi=96&amp;amp;format=png32&amp;amp;transparent=true&amp;amp;layers=show%3A4%2C51%2C7%2C12%2C54%2C15%2C20%2C57%2C23%2C28%2C60%2C31%2C48%2C63%2C43&amp;amp;f=image&amp;amp;token=ABC123" target="_blank" rel="noopener"&gt;https://traffic.arcgis.com/arcgis/rest/services/World/Traffic/MapServer/export?bbox=2969828.768378092%2C-3115102.2103630807%2C2984695.7703795386%2C-3098763.7955671465&amp;amp;bboxSR=102100&amp;amp;imageSR=102100&amp;amp;size=778%2C855&amp;amp;dpi=96&amp;amp;format=png32&amp;amp;transparent=true&amp;amp;layers=show%3A4%2C51%2C7%2C12%2C54%2C15%2C20%2C57%2C23%2C28%2C60%2C31%2C48%2C63%2C43&amp;amp;f=image&amp;amp;token=ABC123&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;It means there is no issue with access token.&lt;BR /&gt;&lt;/SPAN&gt;I dont know why it is failing to authenticate on Mobile only.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Is this an API Key issue ? Does traffic service needs to be enabled for this particular API Key / Account ?&lt;BR /&gt;&lt;BR /&gt;Please help me resolved this issue.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Prashant&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jan 2026 13:07:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/world-traffic-service-failed-to-render-due-to/m-p/1678603#M631</guid>
      <dc:creator>PrashantGaykar</dc:creator>
      <dc:date>2026-01-19T13:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: World Traffic Service failed to render due to Authentication issue.</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/world-traffic-service-failed-to-render-due-to/m-p/1683134#M633</link>
      <description>&lt;P&gt;Hi Prashant, sorry about the delay in responding here. Can you please confirm a couple of details to help us with our investigation?&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;For the API key access token you are creating, is this through an ArcGIS Location Platform account, or an ArcGIS Online account?&lt;/LI&gt;&lt;LI&gt;In your two efforts to gain access to the traffic service&lt;SPAN&gt;—&lt;/SPAN&gt;first via your Kotlin app, and second via URL (presumably browser)&lt;SPAN&gt;—&lt;/SPAN&gt;is the access token you're supplying the same one? Or are you creating these separately?&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Mon, 09 Feb 2026 18:54:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/world-traffic-service-failed-to-render-due-to/m-p/1683134#M633</guid>
      <dc:creator>MikeWilburn</dc:creator>
      <dc:date>2026-02-09T18:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: World Traffic Service failed to render due to Authentication issue.</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/world-traffic-service-failed-to-render-due-to/m-p/1683248#M634</link>
      <description>&lt;P&gt;It turns out this is a known limitation where API keys cannot be used to access ArcGIS map image layers directly. However, we can still get this to work by creating a &lt;A href="https://developers.arcgis.com/kotlin/api-reference/arcgis-maps-kotlin/com.arcgismaps.httpcore.authentication/-pregenerated-token-credential/index.html?query=class%20PregeneratedTokenCredential%20:%20ArcGISCredential" target="_self"&gt;PregeneratedTokenCredential&lt;/A&gt; with your API key and adding this to the ArcGIS credential store.&lt;BR /&gt;&lt;BR /&gt;Here's how that would look:&lt;/P&gt;&lt;LI-CODE lang="kotlin"&gt;val trafficLayer = "https://traffic.arcgis.com/arcgis/rest/services/World/Traffic/MapServer/"

val tokenInfo = TokenInfo(
    accessToken = apiKey.toString(),
    expirationDate = Instant.now().plus(Duration.ofHours(2)), //an expiration equal to or less than your API key expiration
    isSslRequired = true
)
val trafficCredential = PregeneratedTokenCredential(
    url = trafficLayer,
    tokenInfo = tokenInfo
)

// Ensure that you add the credential to the store prior to loading the layer
ArcGISEnvironment.authenticationManager.ArcGISCredentialStore.add(trafficCredential)

// Continue with loading the traffic layer&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 10 Feb 2026 00:56:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/world-traffic-service-failed-to-render-due-to/m-p/1683248#M634</guid>
      <dc:creator>MikeWilburn</dc:creator>
      <dc:date>2026-02-10T00:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: World Traffic Service failed to render due to Authentication issue.</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/world-traffic-service-failed-to-render-due-to/m-p/1683276#M635</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/181437"&gt;@MikeWilburn&lt;/a&gt;&amp;nbsp;, thank you for replying.&lt;BR /&gt;following are the answer's to your questions respectively.&lt;BR /&gt;&lt;BR /&gt;1. We are using&amp;nbsp;&lt;SPAN&gt;ArcGIS Online account to create access token.&lt;BR /&gt;2. For both platforms (App and Web) we are using different access token. We also tried using Web access token in app but faced same error.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Feb 2026 06:03:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/world-traffic-service-failed-to-render-due-to/m-p/1683276#M635</guid>
      <dc:creator>PrashantGaykar</dc:creator>
      <dc:date>2026-02-10T06:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: World Traffic Service failed to render due to Authentication issue.</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/world-traffic-service-failed-to-render-due-to/m-p/1683278#M636</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/181437"&gt;@MikeWilburn&lt;/a&gt;&amp;nbsp;, Thank you for the code.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I will try this and let you know if this works.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Feb 2026 06:07:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/world-traffic-service-failed-to-render-due-to/m-p/1683278#M636</guid>
      <dc:creator>PrashantGaykar</dc:creator>
      <dc:date>2026-02-10T06:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: World Traffic Service failed to render due to Authentication issue.</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/world-traffic-service-failed-to-render-due-to/m-p/1684481#M637</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/181437" target="_blank"&gt;@MikeWilburn&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;, your solution worked. Thank you very much !&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 14 Feb 2026 07:35:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/world-traffic-service-failed-to-render-due-to/m-p/1684481#M637</guid>
      <dc:creator>PrashantGaykar</dc:creator>
      <dc:date>2026-02-14T07:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: World Traffic Service failed to render due to Authentication issue.</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/world-traffic-service-failed-to-render-due-to/m-p/1684752#M638</link>
      <description>&lt;P&gt;Fantastic - glad to hear it!&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2026 16:50:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/world-traffic-service-failed-to-render-due-to/m-p/1684752#M638</guid>
      <dc:creator>MikeWilburn</dc:creator>
      <dc:date>2026-02-17T16:50:35Z</dc:date>
    </item>
  </channel>
</rss>

