Skip to content

Commit 4098592

Browse files
committed
Revert "Update style picker auth method"
This reverts commit 514ea4e.
1 parent 514ea4e commit 4098592

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

‎Samples/Controls/Map Style Picker/Map Style Picker.html‎

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,14 @@
2828

2929
//Add authentication details for connecting to Azure Maps.
3030
authOptions: {
31-
// Use SAS token for authentication
32-
authType: 'sas',
33-
getToken: (resolve, reject) => {
34-
// URL to your authentication service that retrieves a SAS Token
35-
fetch('https://samples.azuremaps.com/api/GetAzureMapsSasToken')
36-
.then(function (response) {
37-
resolve(response);
38-
})
39-
.catch(function (error) {
40-
reject(new Error(`Failed to fetch Azure Maps SAS token: ${error.message}`));
41-
});
31+
//Use Microsoft Entra ID authentication.
32+
authType: 'anonymous',
33+
clientId: 'e6b6ab59-eb5d-4d25-aa57-581135b927f0', //Your Azure Maps client id for accessing your Azure Maps account.
34+
getToken: function (resolve, reject, map) {
35+
//URL to your authentication service that retrieves an Microsoft Entra ID Token.
36+
var tokenServiceUrl = 'https://samples.azuremaps.com/api/GetAzureMapsToken';
37+
38+
fetch(tokenServiceUrl).then(r => r.text()).then(token => resolve(token));
4239
}
4340

4441
//Alternatively, use an Azure Maps key. Get an Azure Maps key at https://azure.com/maps. NOTE: The primary key should be used as the key.

0 commit comments

Comments
 (0)