Azure / azure-functions-microsoftgraph-extension

Microsoft Graph extension for Azure Functions
MIT License
46 stars 23 forks source link

Client credentials flow breaking #25

Closed mattchenderson closed 6 years ago

mattchenderson commented 6 years ago

If you attempt to use the client credentials flow, you will get an error stating that your application "was not found in the directory microsoft.com." The "microsoft.com" piece will occur no matter what tenant your application is in.

Early guess is that this is due to us using the common endpoint, when a client credentials flow should be against a proper tenant. You can verify this by attempting the flow manually in postman using the common endpoint.

ConnorMcMahon commented 6 years ago

This was addressed here. Expect in in the next release of functions.

TechWatching commented 6 years ago

@ConnorMcMahon Do you when when is the next release planned ? In the meantime do you know a workaround for this ? I need client credentials to use the new outlook azure functions templates.

APraestegaard commented 6 years ago

@mattchenderson - you wrote:

You can verify this by attempting the flow manually in postman using the common endpoint.

I can verify this in Postman using the following configuration:

postman graph client credentials setup

I have a non-azure-functions-related need to call Graph-endpoints and as I understand I need to replace "common" with the tenant id in the Access Token Url: https://login.microsoftonline.com/common/oauth2/v2.0/token (?). Doing so I will get an accesstoken, but the response from the endpoint (https://graph.microsoft.com/v1.0/deviceManagement/managedDevices) using that token is beyond me:

postman graph client credentials error

Note: The same endpoint returns Intune managed device data if I use the Authorization Code grant flow in Postman with the same client id& secret!

Would you have any advice?