# Sign in with Microsoft

## Overview

Servoy Cloud provides a **Sign-in with Microsoft** option to simplify user authentication. Follow these steps to enable Microsoft SSO for your application.

## Prerequisites

* **Azure Account**: Sign up for an account on the[ Azure portal](https://azure.microsoft.com/en-us/free/?ref=microsoft.com\&utm_source=microsoft.com\&utm_medium=docs\&utm_campaign=visualstudio)

## Set up SSO in Servoy Cloud

To enable Microsoft SSO in Servoy Cloud, complete the [setup in the Security Login Designer](https://docs.servoy.com/reference/servoy-cloud/cloud-control-center/application-overview/applications/security/security-login-designer/single-sign-on/..#setup-sso).

## Setup App in Microsoft

### Create a New Application

Register an app in Azure using Microsoft's Entra admin center:

1. Log in to to [Microsoft Entra](https://entra.microsoft.com/) with your Microsoft account
2. Go to `Identity > Applications > App registrations`
3. Click on `+ New Registration` to create a new app and enter:
   * Application name
   * Supported account types
   * (Optional) Redirect URI — you may skip this step initially.
4. You are now on the `App registration details page` and ready for the next step

{% hint style="info" %}
In the **Overview** section, find your **Application (Client) ID** and **Directory (Tenant) ID**—both are required for SSO setup.
{% endhint %}

### Create a Client Secret

To generate the client secret required for a successful SSO setup in Servoy Cloud:

1. Navigate to the `App registration details` if you have already completed the steps above
   * Log in to [Microsoft Entra](https://entra.microsoft.com/) with your Microsoft account
   * Go to `Identity > Applications > App registrations`
   * Click on your application from the list
2. Navigate to `Certificates & secrets > Client secrets`
3. Create a new client secret by clicking `New Client Secret`
   * Fill in the name and set an expiration date
   * Save your client secret ID

{% hint style="info" %}
The **Client Secret ID** along with the **Directory (Tenant ID)** and **Application (Client) ID** are required when setting up single sign-on in Cloud Control Center.
{% endhint %}

### Set up Redirect URI and ID Token

To set up the redirect URI of your Microsoft app:

1. Navigate to the `App registration details` if you have already completed the steps above
   * Log in to [Microsoft Entra](https://entra.microsoft.com/) with your Microsoft account
   * Go to `Identity > Applications > App registrations`
   * Click on your application from the list
2. Navigate to `Manage > Authentication > Platform configurations`
3. Click `Add a platform` and choose `Web`
4. Set the redirect URI with the value found in Cloud Control Center:
   * Navigate to `Application Details > Security Designer`
   * Expand menu `Sign in with Microsoft`
   * Copy the value found by clicking `Setup Guide` link
5. Check `ID Token` from `Implicit grant and hybrid flows` section

## Finish SSO Setup

To finish SSO Setup and enable it for your Servoy Cloud Application:

1. **Access Servoy Cloud Application Settings**:
   * Go to `Application -> Your Application -> Application Settings` using the `Configure` button.
2. **Enable Sign-in with Microsoft**
   1. Click the `Create custom login` button.
   2. Navigate to the `Security Login` page.
   3. Expand the `Sign in with Microsoft` section.
   4. Fill in the generated `Tenant ID`, `Application(Client) ID` and `Client Secret ID`
3. **Save settings**

{% hint style="success" %}
Your application now supports **Microsoft Single Sign-On** for user authentication.
{% endhint %}
