arnaudleclerc / AzureMapsControl.Components

Razor Components for azure-maps-control
MIT License
34 stars 12 forks source link

x-ms-client-id is undefined when using anonymous authentication #38

Closed philvessey closed 3 years ago

philvessey commented 3 years ago

Describe the bug I have a valid access token from aad and I can see the token being passed in the Authorization header so the javascript function to get the token from my backend service is working. However as per https://docs.microsoft.com/en-us/azure/azure-maps/azure-maps-authentication there should also be x-ms-client-id in the header and that value should be the same as the configuration client id passed into the library configuration. However in the header, it is undefined.

header

This results in 401 unauthorised being returned from azure maps.

Expected behavior x-ms-client-id should be set to the configuration client id passed into the library configuration.

philvessey commented 3 years ago

Tested in Postman with the token in the Authorization header and the clientid in x-ms-client-id and valid results are returned so everything configured correct in Azure. The library isn't populating x-ms-client-id which is the issue.

arnaudleclerc commented 3 years ago

Sounds right, I apparently forgot to affect it. I'll make a fix ASAP.

philvessey commented 3 years ago

Thanks, once updated ill test to make sure working as expected.

arnaudleclerc commented 3 years ago

@philvessey I have published a v 0.17.1-beta0001 where the client id should be part of the requests. Could you please check if it works for you ? If yes, I will publish later a 0.17.1

philvessey commented 3 years ago

Sure will have a look later on today.

philvessey commented 3 years ago

Working fine on 0.17.1-beta0001. Thanks for quick fix.

arnaudleclerc commented 3 years ago

Great, thanks for the feedback! I have now published a stable 0.17.1 containing the fix. I will close this issue, feel free to reopen it if necessary.