Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for use with Microsoft Graph #979

Open
wants to merge 1 commit into
base: master
from
Open

Conversation

@plutext
Copy link

@plutext plutext commented Aug 21, 2020

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.

@plutext
Copy link
Author

@plutext plutext commented Aug 22, 2020

A quote from the Microsoft documentation at https://docs.microsoft.com/en-us/graph/auth-v2-service#endpoint-considerations

Microsoft continues to support the Azure AD endpoint. There are several differences
between using the Microsoft identity platform endpoint
and the Azure AD endpoint.

When using the Azure AD endpoint, the parameters in authorization and token requests are different.

For example, there is no scope parameter in Azure AD endpoint requests;
instead, the resource parameter is used to specify the URI of the resource
(resource=https://graph.microsoft.com) that authorization (for administrator consent) or a token is being requested for.

So in this PR I'm evidently using the Azure AD endpoint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.