Ich authentifiziere mich mit Client ID und Secret.Microsoft Graph API-Inhalt 401 Nicht autorisiert
String url = String.format("https://login.microsoftonline.com/%s/oauth2/token", tenantContext);
AuthenticationContext context = new AuthenticationContext(url, true, ForkJoinPool.commonPool());
AuthenticationResult result = context.acquireToken("https://graph.microsoft.com", new ClientCredential(clientId, clientSecret), null).get();
String token = result.getAccessTokenType() + " " + result.getAccessToken();
Meine Anwendung hat alle Erlaubnis Anforderungen erfüllen und mit dem oben Token kann ich Benutzer auflisten und ihre Laufwerke und Ordner durchquert. Ich kann auf Inhalt von https://graph.microsoft.com/v1.0/drives/%s/items/%s/content zugreifen, die eine andere URL in der Location-Kopfzeile zurückgibt. Wenn ich jedoch versuche, diese URL zu erhalten, wird 401 Nicht autorisiert zurückgegeben.
Alternativ enthält das Element json ein Feld der Form: '" @ microsoft.graph.downloadUrl ":" https: // {Mieter} -my.sharepoint.com/personal/ {user} _ {Mieter} _onmicrosoft_com/_layouts/15/download.aspx? UniqueId = ... & access_token = ... & proctoken = ... "' was aussieht, als ob man darauf zugreifen können sollte, aber das funktioniert auch nicht. – Alastair