ITrustFrameworkPolicyCollectionPage "Can not be resolved to a type"

ITrustFrameworkPolicyCollectionPage "Can not be resolved to a type"

我正在尝试使用图形 API 获取 "Azure B2C AD TrustFrameworkPolicy" 的列表 Java

这些是我在 POM 中的依赖项

        <dependency>
            <groupId>com.microsoft.graph</groupId>
            <artifactId>microsoft-graph</artifactId>
            <version>2.3.2</version>
        </dependency>
        <dependency>
            <groupId>com.microsoft.graph</groupId>
            <artifactId>microsoft-graph-core</artifactId>
            <version>1.0.5</version>
        </dependency>
        <dependency>
            <groupId>com.microsoft.graph</groupId>
            <artifactId>microsoft-graph-auth</artifactId>
            <version>0.2.0</version>
        </dependency>

我有 clientId、secret 和 b2ctenant

我正在创建身份验证提供程序:

 ClientCredentialProvider authProvider = 
            new ClientCredentialProvider(clientId,
                    scopes,
                    clientSecret,
                    b2cTenantId,
                    endpoint);

并在图形服务客户端中使用身份验证提供程序,

    IGraphServiceClient graphClient = GraphServiceClient.builder()
                              .authenticationProvider(authProvider)
                              .buildClient(); 

但是当我使用“ITrustFrameworkPolicyCollectionPage”时出现错误 -> 无法解析为类型

    ITrustFrameworkPolicyCollectionPage policies = graphClient.trustFramework().policies()
            .buildRequest()
            .get();

我正在尝试查找我错过了哪个 Maven 依赖项,或者我不明白为什么它不起作用。请一些人帮忙。

URL https://docs.microsoft.com/fr-fr/graph/api/trustframework-list-trustframeworkpolicies?view=graph-rest-beta&tabs=java

暂时坏了...

改用这个...

         ClientCredentialProvider authProvider = 
                 new ClientCredentialProvider(clientId,
                         scopes,
                         clientSecret,
                         b2cTenantId,
                         endpoint); 
        
         OkHttpClient client = HttpClients.createDefault(authProvider);
         Request request = new Request.Builder().url("https://graph.microsoft.com/beta/trustFramework/policies/B2C_1A_User_MigrationClients/$value").build();
         Response response = client.newCall(request).execute();
         System.out.println(response.body().string());

这将为您提供 XML 您需要的只是政策。