Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 通过MS Graph API访问AzureAD组列表需要什么范围?_Javascript_Node.js_Azure_Microsoft Graph Api - Fatal编程技术网

Javascript 通过MS Graph API访问AzureAD组列表需要什么范围?

Javascript 通过MS Graph API访问AzureAD组列表需要什么范围?,javascript,node.js,azure,microsoft-graph-api,Javascript,Node.js,Azure,Microsoft Graph Api,我正在尝试向Node.JS中编写的MS Graph API应用程序添加一个功能。该应用程序是从一个应用程序构建的。应用程序需要获取名称以前缀开头的Azure广告组列表。我很难让它工作 我复制了这个工作代码: const client = graph.Client.init({...}); const events = await client .api('/me/events') .select('subject,organizer,start,end') .orderby('cre

我正在尝试向Node.JS中编写的MS Graph API应用程序添加一个功能。该应用程序是从一个应用程序构建的。应用程序需要获取名称以前缀开头的Azure广告组列表。我很难让它工作

我复制了这个工作代码:

const client = graph.Client.init({...});
const events = await client
  .api('/me/events')
  .select('subject,organizer,start,end')
  .orderby('createdDateTime DESC')
  .get();
…并根据我找到的。我已经注释掉了过滤器,只是为了让基本查询正常工作

const client = graph.Client.init({...});
const events = await client
  .api('/groups')
  .select('id,displayName')
  // .filter("startsWith(displayName,'Prefix')")
  .get();
但查询返回以下错误:

GraphError {
  statusCode: 403,
  code: 'Authorization_RequestDenied',
  message: 'Insufficient privileges to complete the operation.',
  requestId: 'f5330dbd-c7a9-4126-a227-10a656a11083',
  date: 2020-07-10T22:25:24.000Z,
  body: '{"code":"Authorization_RequestDenied"...}'
}
我不是100%确定URI是正确的。如果URI是错误的,我会期望404,但这可能期望太高了。可能此
/group
API与Azure广告组不相关

OTOH,我需要添加一个新的作用域来请求访问组信息吗?应用程序使用的当前作用域列表如下所示:

OAUTH_SCOPES='profile offline_access user.read calendars.read'
我没有找到Azure AD的图形查询和作用域的引用。我尝试将“groups.read”添加到作用域列表中,但没有成功


我希望您不仅能给我一个答案,而且能提供文档链接。我必须从Azure AD中添加一些其他功能。

查询组的最低到最高特权权限是
Group.Read。所有的
都根据您的链接文档