I'm trying to embed Azure Time Series insights. The stub applications provides the code to do that. I created an app registration and added Time Series insights API permissions to it. I also created my own Time series environment with an event source.
Now the authentication in JS library is achieved using ADAL with this piece of code.
var authContext = new AuthenticationContext({
clientId: 'xxxxx',
postLogoutRedirectUri: 'https://insights.timeseries.azure.com',
cacheLocation: 'localStorage'
});
And with this piece of code I'm getting an access token.
var promise = new Promise(function (resolve, reject) {
authContext.acquireToken(
'https://api.timeseries.azure.com/',
function (error, token) {
console.log(token);
if (error || !token) {
console.log('Here');
// TODO: Handle error obtaining access token
document.getElementById('api_response').textContent = error;
document.getElementById('loginModal').style.display = "block";
document.getElementById('api_response2').textContent = '';
return;
}
//console.log('Token is ' + token);
// Use the access token
document.getElementById('api_response').textContent = '';
document.getElementById('api_response2').textContent = '';
document.getElementById('loginModal').style.display = "none";
resolve(token);
}
);
});
Now, if I want to embed this application for all users and not just me what would I do? If I remove myself from Data Access policies within the time series environment I get a 404 saying resource not found. Can I use any other authentication method?
Can I simply use app registration itself with client Id and secret?