From 6d9d1079d3f1581b08a7edd82b8d53bab29db4f5 Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Mon, 27 Jul 2020 09:03:04 -0700 Subject: [PATCH] Update docs to use https://graph.windows.net as tokenAudience for graph (#5187) --- Documentation/Authentication.md | 8 ++++---- lib/services/graphManagement/README.md | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Documentation/Authentication.md b/Documentation/Authentication.md index a56a0ff8b..4db5910df 100644 --- a/Documentation/Authentication.md +++ b/Documentation/Authentication.md @@ -45,13 +45,13 @@ MsRest.interactiveLogin((err, credentials) => { ### For azure-graph sdk -One needs to set the tokenAudience to 'graph' and provide the tenantId in the options object. +One needs to set the tokenAudience to 'https://graph.windows.net' and provide the tenantId in the options object. ```javascript const AzureGraphClient = require('azure-graph'); const MsRestAzure = require('ms-rest-azure'); const options = { - tokenAudience: 'graph', + tokenAudience: 'https://graph.windows.net', domain: '' }; @@ -191,13 +191,13 @@ MsRest.loginWithServicePrincipalSecret( ### For azure-graph sdk -One needs to set the tokenAudience to 'graph' and provide the tenantId in the options object. +One needs to set the tokenAudience to 'https://graph.windows.net' and provide the tenantId in the options object. ```javascript const AzureGraphClient = require('azure-graph'); const MsRestAzure = require('ms-rest-azure'); const options = { - tokenAudience: 'graph', + tokenAudience: 'https://graph.windows.net', domain: '' }; diff --git a/lib/services/graphManagement/README.md b/lib/services/graphManagement/README.md index 765c1b3d2..5ff5e1ddf 100644 --- a/lib/services/graphManagement/README.md +++ b/lib/services/graphManagement/README.md @@ -21,13 +21,13 @@ npm install azure-graph // It provides a url and code that needs to be copied and pasted in a browser and authenticated over there. If successful, // the user will get a DeviceTokenCredentials object. - //Note: You need to explicitly specify the tokenAudience as graph and the your domain (tenantId) in which the AD Graph exists. + //Note: You need to explicitly specify the tokenAudience as https://graph.windows.net and the your domain (tenantId) in which the AD Graph exists. // This needs to be done only for working graph clients. For other ARM clients specifying this information is not required. var tenantId='abcd-efgh-ijk-lmno-12345'; // Enter your tenant ID here which can be found from your Azure AD URL // Eg. https://manage.windowsazure.com/example.com#Workspaces/ActiveDirectoryExtension/Directory//users - msRestAzure.interactiveLogin({ tokenAudience: 'graph', domain: tenantId }, function (err, credentials, subscriptions) { + msRestAzure.interactiveLogin({ tokenAudience: 'https://graph.windows.net', domain: tenantId }, function (err, credentials, subscriptions) { if (err) console.log(err); var client = new graphRbacManagementClient(credentials, tenantId); var userParams = { @@ -64,7 +64,7 @@ npm install azure-graph // Enter your tenant ID here which can be found from your Azure AD URL // Eg. https://manage.windowsazure.com/example.com#Workspaces/ActiveDirectoryExtension/Directory//users - msRestAzure.loginWithUsernamePassword('username@contosocorp.onmicrosoft.com', 'your-password', { tokenAudience: 'graph', domain: tenantId }, function (err, credentials, subscriptions) { + msRestAzure.loginWithUsernamePassword('username@contosocorp.onmicrosoft.com', 'your-password', { tokenAudience: 'https://graph.windows.net', domain: tenantId }, function (err, credentials, subscriptions) { if (err) console.log(err); var client = new graphRbacManagementClient(credentials, tenantId); var userParams = { @@ -101,7 +101,7 @@ npm install azure-graph // Enter your tenant ID here which can be found from your Azure AD URL // Eg. https://manage.windowsazure.com/example.com#Workspaces/ActiveDirectoryExtension/Directory//users - msRestAzure.loginWithServicePrincipalSecret('clientId', 'application-secret', tenantId, { tokenAudience: 'graph' }, function (err, credentials, subscriptions) { + msRestAzure.loginWithServicePrincipalSecret('clientId', 'application-secret', tenantId, { tokenAudience: 'https://graph.windows.net' }, function (err, credentials, subscriptions) { if (err) console.log(err); var client = new graphRbacManagementClient(credentials, tenantId); var userParams = {