diff --git a/step-004-map-visualization/README.md b/step-004-map-visualization/README.md index d76037f..5b26003 100644 --- a/step-004-map-visualization/README.md +++ b/step-004-map-visualization/README.md @@ -9,16 +9,17 @@ Contoso Art Shipping is interested in being able to visualize in real-time the l ## Steps -* [Create an Azure Maps account](#create-an-azure-maps-account) -* [Setup your local development environment](#setup-your-local-development-environment) -* [Complete the JavaScript code](#complete-the-javascript-code) - * [Replace global variables](#replace-global-variables) - * [Initialize the Maps component](#initialize-the-maps-component) - * [Create map layers, data sources, and mouse events](#create-map-layers-data-sources-and-mouse-events) - * [Map highlighting functions](#map-highlighting-functions) - * [Query TSI](#query-tsi) - * [Create a chart](#create-a-chart) -* [Test the application](#test-the-application) +- [Create an Azure Maps account](#create-an-azure-maps-account) +- [Setup your local development environment](#setup-your-local-development-environment) +- [Complete the JavaScript code](#complete-the-javascript-code) + - [Replace global variables](#replace-global-variables) + - [Initialize the Maps component](#initialize-the-maps-component) + - [Create map layers, data sources, and mouse events](#create-map-layers-data-sources-and-mouse-events) + - [Map highlighting functions](#map-highlighting-functions) + - [Query TSI](#query-tsi) + - [Create a chart](#create-a-chart) + - [Change the AuthenticationContext](#change-the-authenticationcontext) +- [Test the application](#test-the-application) ### Create an Azure Maps account @@ -413,6 +414,21 @@ tsiClient.server.getTsqResults(token, TSI_FQDN, linechartTsqExpressions.map(func }); ``` +#### Change the AuthenticationContext + +Next to replacing the several `TODO`s throughout the [`script.js`](./webapp/script.js) file, we also need to change one placeholder in the [`auth.js`](./webapp/auth.js) file. + +Replace the placeholder with your AAD TenantID in following section: + +```javascript + authContext = new AuthenticationContext({ + authContextProperties, + cacheLocation: 'localStorage', + tenant: '', + clientId: '120d688d-1518-4cf7-bd38-182f158850b6' + }); +``` + ### Test the application Open a web browser and navigate to [https://insights-local.timeseries.azure.com/mapsexample.html](https://insights-local.timeseries.azure.com/mapsexample.html). diff --git a/step-004-map-visualization/webapp/auth.js b/step-004-map-visualization/webapp/auth.js index 96d54cd..70d335c 100644 --- a/step-004-map-visualization/webapp/auth.js +++ b/step-004-map-visualization/webapp/auth.js @@ -29,7 +29,13 @@ function initAuth(title){ var authContextProperties = window.location.href.indexOf('tsiclientsample') !== -1 ? { postLogoutRedirectUri: 'https://tsiclientsample.azurewebsites.net', clientId: '11a652b9-f29f-40c8-ab29-5ccbe2271823', cacheLocation: 'localStorage' } : { postLogoutRedirectUri: 'https://insights.timeseries.azure.com', clientId: '120d688d-1518-4cf7-bd38-182f158850b6' , cacheLocation: 'localStorage'}; - authContext = new AuthenticationContext(authContextProperties) + + authContext = new AuthenticationContext({ + authContextProperties, + cacheLocation: 'localStorage', + tenant: '', + clientId: '120d688d-1518-4cf7-bd38-182f158850b6' + }); if (authContext.isCallback(window.location.hash)) {