Using Microsoft Graph with delegated permission in script

Sebastian M 20 Reputation points

We are trying to access to Microsoft Graph API using a delegated permission without interaction with the user (In a daemon app).

We tried OAuth 2.0 On-Behalf-Of flow but this flow require user to logging in a browser.

We tried OAuth 2.0 Resource Owner Password Credentials but this flow is not supported with AD FS used to authenticate on-premises accounts.

¿How can we get a token in an autonomous way?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
9,096 questions
0 comments No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 31,816 Reputation points

    Hi @Sebastian M

    You cannot use delegated permissions within a daemon. The daemon usually runs on the backend without user interaction, it only supports application permissions rather than delegated permissions, and the corresponding authentication flow is the client credentials flow.

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful