Hi,
am trying to view the subscription details of customer.
Im using .net background. By passing client ID and secret key , i have got AAD token.
Now to proceed further on this , i need to execute below code in my application.
But am not sure where should i write this code:
var tenant_domain = "<YOUR-TENANT-DOMAIN>";
var clientID = "<YOUR-CLIENT-ID>";
var key = "<YOUR-SECRET-KEY>";
function getAADToken(callback) {
var req = require("request");
var options = {
url: "https://login.windows.net/" + tenant_domain + "/oauth2/token?api-version=1.0",
method: 'POST',
form: {
grant_type: "client_credentials",
resource: "https://graph.windows.net",
client_id: clientID,
client_secret: key
}
};
req(options, function (err, resp, body) {
if (err || resp.statusCode !== 200) callback(err, null);
else callback(null, JSON.parse(body).access_token);
});
}
there is only guidelines to execute this as a mobile service.
do i need to create a web API project in .net ?
Any help will be highly appreciated