Outlook authentication through rest api

Uphus K.C.P. (Kevin) 31 Reputation points
2022-03-08T14:00:28.687+00:00

For testautomation purposes I would like to access my corporate email address through REST api calls. The problem is logging in. In all the documentation I found concerning this topic, you had to register an app. I'm not allowed to do so. And I don't think it is necessary, since I just want to poll my email to check if certain automatic emails are received.

Short questions is; Is there a way to receive the authentication token through a REST api when I only have my username/email address and a password?

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

Accepted answer
  1. JanardhanaVedham-MSFT 3,536 Reputation points
    2022-03-08T15:36:55.963+00:00

    Hi @Uphus K.C.P. (Kevin) ,

    App registration in Azure AD is manditory to get the OAuth 2.0 access or authentication token to access the data in Microsoft Graph either using REST APIs or SDKs. There is a OAuth 2.0 Resource Owner Password Credentials (ROPC) grant authentication flow but it does require App ID (or Client ID).

    181141-image.png

    Documentation Reference :

    https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth-ropc#authorization-request

    Hope this helps.

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

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. CarlZhao-MSFT 37,786 Reputation points
    2022-03-09T03:21:12.377+00:00

    Hi @Uphus K.C.P. (Kevin)

    You can log in to Graph Explorer with your username/password and it will automatically configure an access token after you log in, you can find it under the Access token option.

    Graph Explorer is actually a multi-tenant application, you can find it in your tenant's enterprise application.

    181243-image.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.