Fixes for use with Microsoft Graph#979
Conversation
|
A quote from the Microsoft documentation at https://docs.microsoft.com/en-us/graph/auth-v2-service#endpoint-considerations
So in this PR I'm evidently using the Azure AD endpoint |
| } | ||
|
|
||
| private static void addBody(HttpURLConnection connection, byte[] content, boolean requiresBody) throws IOException { | ||
| if (!requiresBody && content==null) return; |
There was a problem hiding this comment.
Could you show when can content be null?
|
It seems, that MicrosoftAzureActiveDirectoryApi.java - is what you need. |
With these changes, it is possible to use Microsoft Graph to upload/convert/delete a file, following https://medium.com/medialesson/convert-files-to-pdf-using-microsoft-graph-azure-functions-20bc84d2adc4
getAccessTokenEndpoint = MSFT_LOGIN_URL + tenant + OAUTH_2 + getEndpointVersionPath() + "/token";
For it to work for me, I have to have an empty EndpointVersionPath.
It is also necessary to pass a resource, to get the audience claim correct. I have hard coded this, but if you process this PR, you'll want to handle this differently.