Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/392.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中返回的json对象获取odata.nextlink并调用odata.nextlink url_Java_Azure Active Directory_Azure Ad Graph Api - Fatal编程技术网

如何从java中返回的json对象获取odata.nextlink并调用odata.nextlink url

如何从java中返回的json对象获取odata.nextlink并调用odata.nextlink url,java,azure-active-directory,azure-ad-graph-api,Java,Azure Active Directory,Azure Ad Graph Api,目前我正在使用 HttpSession session = (HttpSession) request.getSession(); AuthenticationResult result = (AuthenticationResult) session.getAttribute(AuthHelper.PRINCIPAL_SESSION_NAME); String accessToken = result.getAccessToken(); Str

目前我正在使用

 HttpSession session = (HttpSession) request.getSession();
        AuthenticationResult result = (AuthenticationResult) session.getAttribute(AuthHelper.PRINCIPAL_SESSION_NAME);
        String accessToken = result.getAccessToken();
        String tenant = session.getServletContext().getInitParameter("tenant");
        url = new URL("https://graph.windows.net/" + tenant + "/users/" + result.getUserInfo().getUniqueId()
                + "/memberOf?api-version=1.6");

        HttpURLConnection con = (HttpURLConnection) url.openConnection();

        // Set the appropriate header fields in the request header.
        con.setRequestMethod("GET");
        con.setRequestProperty("api-version", "1.6");
        con.setRequestProperty("Authorization", "Bearer " + accessToken);
        con.setRequestProperty("Accept", "application/json;odata=minimalmetadata");


    jsonResponse = HttpClientHelper.getResponseStringFromConn(con, true);
返回用户所属的组。它被限制为100,我正在获取odata.nextlink。我目前不知道如何使用它并调用graph api来获取下一组100

请帮忙!!
或者有没有办法将响应极限提高到100以上?

通常,odata.nextlink将显示如下内容:directoryObjects/$/Microsoft.DirectoryServices.User/b202e3e2-ead2-4878-8f77-81889ce30989/memberOf?$skiptoken=X'44537074090000000000000000000005948A9EA0D7571449DAAEF76844271C101000000000000000000000000000000000000000017312E322E3834302E3313335362E312E342E34233310200000000001802332059727941B538A64692E459E9'

然后,您只需要生成一个新的请求url:newURL(“+tenant+”/“+odata.netlink+”&api version=1.6”)

然后,只需使用授权标头发出另一个请求

谢谢