当前我正在使用
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。我目前不知道该如何使用它并想起图表API来获取下一组100
请帮助!! 还是有什么办法可以将响应限制提高到大于100?
答案 0 :(得分:0)
通常,odata.nextlink通常显示如下: directoryObjects / $ / Microsoft.DirectoryServices.User / b202e3e2-ead2-4878-8f77-81889ce30989 / memberOf? em>
然后,您只需要生成一个新的请求url为: new URL(“ https://graph.windows.net/” +租户+“ /” + odata.netlink +“&api-version = 1.6” );
然后,再发出一个带有Authorization标头的请求。
谢谢。