# Microsoft Sign in Configuration

It requires Microsoft Graph Application registration. Start at the Microsoft azure portal:\
[https://azure.microsoft.com/en-us/features/azure-portal/](https://azure.microsoft.com/en-us/features/azure-portal/)

**Application registration**: Go to the App registrations and click on New registration:

![New registration](SMTP-Microsoft-Graph-XOAUTH-2-Integration/new_registration.png)

Name it. Select **Single-page Application** as platform. The redirect url must ends with :**WebInterface/login.html**. Then click on register.

![App reg config](CrushOAuth/app_reg_config.png)

Make sure that MSAL.js 2.0, Implicit grant (Access Token, ID Token) grant types are permitted.

![App reg auth config](CrushOAuth/app_reg_auth_config.png)

Get Client Id and Tenant Id from App registration -> Overview.

![Client id](MicrosoftMails/client_id.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).\
![Port item settings ms](CrushOAuth/port_item_settings_ms.png)

**!!!Continue on:** [CrushOAuth](CrushOAuth.md)
