Azure Map Leaflet plugin token expired handling

Janrey Ocfemia 35 Reputation points

I'm using the Azure Maps Leaflet plugin

I've run into an issue when using "anonymous" authentication type eg. ( The issue occurs when the map token has expired and the user closes the tab then re-opens, they'll get an exception/error "Token Expired, Try again". It doesn't appear that azure-maps-leaftlet handles expired tokens. It seems to store the token in local storage but doesn't handle the expiry.

Does anyone know if azure-maps-leaflet will be able to support expired token handling in future?

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
654 questions
0 comments No comments
{count} vote

Accepted answer
  1. rbrundritt 16,456 Reputation points Microsoft Employee

    Checking the source code of the Azure Maps leaflet control there does appear to be code to handle token expiry when the map is reloaded and the token is retrieved from cache:

    That said, I think there may be some room for improvement. It looks like it doesn't monitor the expiry time of a token retrieved from cache. I've just pushed an update to that project that should handle this better. Grab the latest code from the dist folder of that project.

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful