It requires Microsoft Graph Application registration. Start at the Microsoft Azure portal:\\
[https://azure.microsoft.com/en-us/features/azure-portal/]\\
\\
__Application registration__: Go to the App registrations and click on New registration:\\
\\
[attachments|SMTP Microsoft Graph XOAUTH 2 Integration/new_registration.png]\\
\\
Name it. Select __Single-page Application__ as a platform. The redirect URL must end with__WebInterface/login.html__. Then click on register.\\
\\
[CrushOAuth/app_reg_config.png]\\
\\
Make sure that MSAL.js 2.0 and Implicit grant (Access Token, ID Token) grant types are permitted.\\ 
\\
[CrushOAuth/app_reg_auth_config.png]\\
\\
Configure the API permissions:\\
\\
[attachments|app_reg_config_permissions.png]\\
\\
Get Client ID and Tenant ID from App registration -> Overview.\\
\\
[MicrosoftMails/client_id.png]\\
\\
__Group info:__\\
\\
You can add groups claim to the token.\\
\\
[attachments|microsoft_group_info.png]\\ 
\\
Go to the __Preferences__-> __Ip/Servers__ and select the __HTTP or HTTPS__ port item(__OAuth Sign in__  Tab) where you want to enable the __Microsoft Sing-In__ button. Check the __"Enable Microsoft Sign in"__ flag and provide the __Client ID__ and __Tenant ID__ of your App registration(mentioned above).\\
[CrushOAuth/port_item_settings_ms.png]\\
\\
__!!!Continue on:__ [CrushOAuth]\\
\\