php-oauth-office365 is a demo showing how to implement OAuth2 for signing in with Microsoft Office365 using PHP.
You need to install the PHP Microsoft Graph SDK with Composer. Either run composer require microsoft/microsoft-graph
or edit your composer.json
file:
{
"require": {
"microsoft/microsoft-graph": "^1.20"
}
}
Edit TENANT_ID, CLIENT_ID, CLIENT_SECRET and URL_REDIRECT constants in the PHP file to match with the Azure configuration above.
Place the PHP file on server with its path matching URL_REDIRECT.