Login in Office 365 in non UI environment

Mitia Tristan 1 Reputation point
2022-12-15T22:40:40.517+00:00

Hi,
I winder if it is possible to login under user using graph REST API in non UI environment.
What I want to achieve is as follows.
I have a Linux server machine which does not have any UI. And I would like to have a possibility to interact with OneDrive API using graph.
After search through the graph api I was able to test authorization flow using simple webengine view but this still involve UI which I would like to avoid if possible.
Thank you

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

1 answer

Sort by: Most helpful
  1. Vasil Michev 118.9K Reputation points MVP Volunteer Moderator
    2022-12-16T08:26:41.113+00:00

    If you want a fully non-interactive experience, use the client credentials flow: https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow
    If you need to run in the context of a user, the ROPC flow is the only non-UI one, but it's not recommended: https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth-ropc
    Instead, consider using the device code or similar flows.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.