Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/384.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/11.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
Java ms Graph api(测试版)访问被拒绝_Java_Azure_Azure Active Directory_Microsoft Graph Api - Fatal编程技术网

Java ms Graph api(测试版)访问被拒绝

Java ms Graph api(测试版)访问被拒绝,java,azure,azure-active-directory,microsoft-graph-api,Java,Azure,Azure Active Directory,Microsoft Graph Api,我正在尝试几种将Microsoft Graph api(测试版)与JAVA结合使用的方法。 (我引用此链接以连接api“”) 我可以使用v1.0的所有功能,但我不能使用beta版 // Build a Graph client graphClient = GraphServiceClient.builder() .authenticationProvider(authProvider) .logger(logger) .buildC

我正在尝试几种将Microsoft Graph api(测试版)与JAVA结合使用的方法。 (我引用此链接以连接api“”) 我可以使用v1.0的所有功能,但我不能使用beta版

    // Build a Graph client
    graphClient = GraphServiceClient.builder()
        .authenticationProvider(authProvider)
        .logger(logger)
        .buildClient();

    //version change 1.0 -> beta
    graphClient.setServiceRoot("https://graph.microsoft.com/beta/");
例如,当我请求下面的代码时,它们成功地返回了JsonObject

JsonObject response = graphClient
        .customRequest("/me/calendar")
        .buildRequest()
        .get();
但当我请求以下代码时

JsonObject response = graphClient
        .customRequest("/me/findRoomLists")
        .buildRequest()
        .get();
它们返回的值低于错误值

There was an unexpected error (type=Internal Server Error, status=500).
Error code: ErrorAccessDenied Error message: Access is denied. Check credentials and try again. GET https://graph.microsoft.com/beta//me/findRoomLists SdkVersion : graph-java/v1.5.0 Authorization : Bearer
我不知道问题出在哪

我使用下面的代码来使用测试版

    // Build a Graph client
    graphClient = GraphServiceClient.builder()
        .authenticationProvider(authProvider)
        .logger(logger)
        .buildClient();

    //version change 1.0 -> beta
    graphClient.setServiceRoot("https://graph.microsoft.com/beta/");
这是我在Azure中的API权限

1. Calendars.ReadWrite
2. Mail.ReadWrite
3. User.ReadBasic.All
4. User.ReadWrite
应用程序范围

app.scopes=User.ReadWrite,Calendars.ReadWrite,Mail.ReadWrite
我应该修改什么来使用测试版? 如果这是一个重复的问题,我很抱歉。

仅包含使用fluent API访问
v1.0
端点的模型和请求生成器。(如果存在特定API,则会有一个

即使使用
graphClient.setServiceRoot(“https://graph.microsoft.com/beta/”
,它仍将使用
/v1.0
类对所有内容进行序列化/反序列化

如果要使用
v1.0
中不存在的资源/属性,则需要使用beta清单

如需了解更多详细信息,请查看此项,Microsoft Graph产品团队的工作人员@Marc LaFleur提到了这一点。

更新:现在有一个可用于beta端点的