Azure Maps OGC service authentication

Tim 21 Reputation points
2020-10-04T18:51:44.867+00:00

Since a couple of months we started using the Azure Maps SDK (with Angular) in our development environment. Thus far we are really happy with the framework, especially with the recently added OGC support in the Spatial IO module.

I did some testing with the OgcMapLayer class and I ran into a problem. In our platform we use a lot of WM(T)S and WFS services, most of these are private and secured with either a basic authentication header or an auth key passed as get parameter in the URL. It looks like the OgcMapLayer class strips off the auth get parameter from the URL, any suggestions how to handle this situation?

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
653 questions
{count} votes

Accepted answer
  1. rbrundritt 16,456 Reputation points Microsoft Employee
    2020-10-05T16:10:20.117+00:00

    The OgcMapLayer and WFSClient build the queries from scratch and grab the basic info needed about the service endpoint from the initial URL you pass in, thus why additional parameters are being removed.

    But all is not lost, the WFSClient has a transformRequest option that lets you customize the request before they are made. For OgcMapLayers, those requests are handled by the map since it does the rendering. The map also has a transformRequest option as well. This will allow you to add any custom parameters or headers you see fit.

    Here is documentation/code sample on using transformRequests with the map: https://video2.skills-academy.com/en-us/azure/azure-maps/map-create#request-transforms


0 additional answers

Sort by: Most helpful