How to create a signin to outlook with ms graph and php

MARCELIN Lois 0 Reputation points
2024-01-16T09:33:50.9366667+00:00

i need an access to e-mail box using my app with php

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Diah.Karim-MSFT 335 Reputation points Microsoft External Staff
    2024-01-18T00:46:20.71+00:00

    Hi Marcelin,

    To access an email from inbox there are couple things need to be done.

    Steps

    1. Register an application - To be able to authenticate with the Microsoft identity platform and get an access token for Microsoft Graph, you will need to create an application registration. You can register it manually using Azure portal or powershell. Refer this page for more details (https://learn.microsoft.com/en-us/openapi/kiota/tutorials/php-azure?tabs=portal#register-an-application). You will also need to add additional API permission for MS Graph - Mail.ReadWrite because you need it to access the email messages. EmailPermission
    2. Next, you create the PHP application. Use Microsoft Kiota library for easy implementation accessing the MS Graph API endpoints. Refer this sample https://learn.microsoft.com/en-us/openapi/kiota/tutorials/php-azure?tabs=portal#create-the-client-application For full sample code using Microsoft Kiota refer to https://github.com/microsoft/kiota-samples/tree/main/get-started/azure-auth/php
    3. To get more information about Mail folders endpoints, refer to this page https://learn.microsoft.com/en-us/graph/api/resources/mailfolder?view=graph-rest-1.0

    Hope this helps.

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

    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.