Sandeep Bhutani
Sandeep Bhutani

Reputation: 629

Read office 365 emails without graph api

I want to read my office365/outlook emails using a python or c# client, just like old imap days. However all links are taking me to graph api. The problem with graph api is, I need to register and app in Azure or I need to know the tenant ID .

As I am not admin of my organization so I don't know these IDs. Is there any way I can read Office365 emails using my username and password?

Upvotes: 0

Views: 2211

Answers (2)

Shweta
Shweta

Reputation: 351

You should be using Get access on behalf of user.

To use Microsoft Graph to read and write resources on behalf of a user, your app must get an access token from the Microsoft identity platform and attach the token to requests that it sends to Microsoft Graph(OAuth 2.0 authorization code grant flow).

Microsoft Graph exposes two kinds of permissions: application and delegated. For apps that run with a signed-in user, you request delegated permissions in the scope parameter. These permissions delegate the privileges of the signed-in user to your app, allowing it to act as the signed-in user when making calls to Microsoft Graph.

Follow the tutorial and see if this works for you.

Upvotes: -1

Tawab Wakil
Tawab Wakil

Reputation: 2313

The short answer is no. The username/password approach you are describing is known as Basic authentication. You may be able to get that to work temporarily using Exchange Web Services (see here and here), but it's being deprecated by Microsoft:

In September 2021, we announced that effective October 1, 2022, we will begin disabling Basic authentication for Outlook, EWS, RPS, POP, IMAP, and EAS protocols in Exchange Online.

The reason is that Basic authentication is outdated and poses a significant security risk. More details here: https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/deprecation-of-basic-authentication-exchange-online

Upvotes: 1

Related Questions