How to Set Up a Private ChatGPT Instance with SSO and MFA
Tags: blog, technical
Published: 2024-03-28 16:49:53

---
title: How to Set Up a Private ChatGPT Instance with SSO and MFA
published: true
date: 2024-03-19 18:19:53 UTC
tags: Blog,Technical
canonical_url: https://www.datawiza.com/blog/technical/how-to-set-up-a-private-chatgpt-instance-with-sso-and-mfa/
---

In the vast landscape of modern technology, advancements in artificial intelligence (AI) continue to establish connections and foster communications between humans and machines in the most intuitive and engaging manner. One such remarkable innovation is ChatGPT, a conversational AI model developed by OpenAI. This article aims to shed light on the importance of establishing a private ChatGPT instance, the integration of critical security measures such as Single Sign-On (SSO) and Multi-Factor Authentication (MFA), and offer a comprehensive guide to set it up with Microsoft Entra ID (Azure AD) as the Identity Provider (IdP).

Note the solution works with any identity provider, like Microsoft Entra, Okta, Google, Ping and others. And it can be easily deployed in any environment, like Azure, AWS, Google Cloud or On-premises. 

## Understanding the Importance of a Private ChatGPT

In the fast-paced, data-driven environment of our digital age, the need for privacy and control over one’s own data is paramount. Establishing a private ChatGPT allows companies to have the liberty to customize, moderate, and closely monitor the AI interactions while also incorporating the specific needs and preferences of their user base. Furthermore, a private ChatGPT can function within the data guidelines and compliance requirements of an organization. Setting up a private ChatGPT ensures that you are putting security, privacy, and control on your terms while leveraging advanced AI technology for efficient and personalized communication.

## Why Incorporate SSO and MFA for ChatGPT

When it comes to ChatGPT, the implementation of SSO and MFA provides a higher degree of access security. Single Sign-On (SSO) enables users to access multiple resources with a single set of credentials, improving user experience by eliminating the need for multiple passwords while providing enhanced security. In turn, Multi-Factor Authentication (MFA) introduces an additional layer of protection by requiring users to provide at least two verification factors to access their accounts, dramatically reducing the chances of fraudulent access.

## Introduction to the Datawiza Private ChatGPT Solution

The solution combines two major components designed to maximize the performance and security of Private ChatGPT:

1. Datawiza Access Proxy (DAP): This essential tool enables MFA, SSO, and detailed access control to your Private ChatGPT.
2. ChatGPT UI: An intuitive interface designed to interact seamlessly with the OpenAI API, enhancing your user experience.

Importantly, our versatile solution isn’t reserved solely for the OpenAI API. It also works hand-in-glove with other AI platforms such as Llama 2, Mistral AI, and Anthropic Claude API.

Refer to the following architectural diagram to visualize how these components integrate:

![private chatgpt instance with sso and mfa](https://www.datawiza.com/wp-content/uploads/2024/03/private-chatgpt-with-sso-and-mfa.png)

### The User Flow in a Nutshell:

Here’s how the user experience is streamlined with our solution:

1. The user attempts to access the Private ChatGPT through a secured URL, such as [https://chatgpt.example.com](https://chatgpt.example.com/).
2. The user is then redirected to Microsoft Entra ID for login, where they complete the MFA process.
3. Upon successful login, the user gains access to the Private ChatGPT UI.
4. The user can now interact with the Private ChatGPT UI, input their prompts, and receive responses directly from the OpenAI API.

With this solution, users gain secure and personalized access to the power of AI, all at their fingertips.

## The Demo: A Private ChatGPT instance with Microsoft Entra SSO and MFA

Take a closer look at the demo below and witness firsthand how a private ChatGPT instance operates seamlessly with SSO and MFA.

 

<iframe title="Demo: A Private ChatGPT instance with SSO and MFA via Datawiza" width="800" height="450" src="https://www.youtube.com/embed/HX8vV78IvFk?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

## Set Up a Secure Private ChatGPT Instance with Datawiza

### Prerequisites

To set up a private ChatGPT, one would need a Datawiza account, Docker, and a ChatGPT User Interface (UI). In essence, these are the building blocks to initiate and install a private ChatGPT.

- An Azure subscription. If you don’t have a subscription, you can get a [trial account](https://azure.microsoft.com/free/)
- A [Microsoft Entra ID tenant](https://docs.microsoft.com/en-us/azure/active-directory/fundamentals/active-directory-access-create-new-tenant) that’s linked to your Azure subscription
- [Docker](https://docs.docker.com/get-docker/) and [docker-compose](https://docs.docker.com/compose/install/) are required to run DAP
- An account with Microsoft Entra ID application [admin permissions](https://docs.microsoft.com/en-us/azure/active-directory/users-groups-roles/directory-assign-admin-roles#application-administrator)
- (Optional) An [SSL Web certificate](https://www.godaddy.com/help/what-is-an-ssl-certificate-542) for publishing services over HTTPS, or use default Datawiza self-signed certs while testing
- OpenAI API Key

### Deploy the Datawiza ChatGPT UI

We provide a ChatGPT UI image, which we use here as an example of a private ChatGPT UI:

| docker run -itd -p 3000:3000 –name datawiza-chatgpt-ui -e OPENAI\_API\_KEY=$OPENAI\_API\_KEY registry.gitlab.com/datawiza/access-proxy:chatgpt-ui |

### Getting Started with Datawiza

To integrate the ChatGPT with Microsoft Entra ID, login to [Datawiza Cloud Management Console](https://console.datawiza.com/) (DCMC).

Welcome to the DCMC homepage! Let’s get started:

Click the orange **Getting Started** button, which will guide you through the configuration steps.

![](https://www.datawiza.com/wp-content/uploads/2024/03/image2.png)

Specify **Name** and **Description** , and click **Next**.

![](https://www.datawiza.com/wp-content/uploads/2024/03/image4.png)

### Add Application

Configure your application with the following values:

- **Platform** : Select **WEB** here.
- **Name** : The name of your application. Put a meaningful name here. I use the ChatGPT App.
- **Application URL** : The external facing URL of the application. For example, _https://chatgpt.example.com_. You can use localhost DNS for testing purposes. I use _https://chatgpt.datawiza.net_.
- **SSL** :  Check the Enable SSL and use datawiza self-signed certificate checkbox for testing. For production, you can upload your certificates.
- **Listen Port** : This is the port that the DAP listens on. For simplicity, you can use the same port as the one in the Application URL above if you are not deploying the DAP behind a Load Balancer.
- **Upstream Servers** : The URL and port combination of the ChatGPT UI. Mine is _http://10.0.0.1:3000_.

Select **Next**.

![](https://www.datawiza.com/wp-content/uploads/2024/03/image6.png)

### IdP Configuration

DCMC provides an innovative one-click integration to help you complete the Microsoft Entra ID configuration. This is the easiest way to install Microsoft Entra ID. DCMC will automatically complete the configuration for you. With one-click integration, you no longer have to fill out the tedious configuration on Microsoft Entra ID or copy the configuration to DCMC. DCMC calls the Graph API to do all the work for you. In this way, management costs are reduced and configuration errors are less likely to happen, ensuring smooth configuration to a large extent.

![](https://www.datawiza.com/wp-content/uploads/2024/03/image3.png)

### Deploy DAP

Once clicking on the **Create** button, the basic configuration on the management console is finished. You will see the final step of the guide, which presents you with a page showing the simple steps to deploy DAP with your application.

![](https://www.datawiza.com/wp-content/uploads/2024/03/image5.png)

### Enable MFA on Microsoft Entra ID

To provide an extra level of security for sign-ins, you can enforce MFA for user sign-in. There are several ways to achieve this. The simplest and easiest way is to enable MFA on the Azure portal.

1. Sign in to the Azure portal as a Global Administrator.
2. Select **Microsoft Entra ID** > **Manage** > **Properties**.
3. Under **Properties** , click the **Manage security defaults**. ![](https://www.datawiza.com/wp-content/uploads/2024/03/image1.png)
4. Under Enable Security defaults, select **Yes** and then **Save**. 

## Connect With Datawiza

Interested in setting up your own Private ChatGPT instance? We’re here to help. [Contact us at Datawiza](https://www.datawiza.com/contact-us/), and our team of experts will assist you in transforming your AI landscape. Or [book a technical demo](https://calendly.com/datawiza/30min) with us.

The post [How to Set Up a Private ChatGPT Instance with SSO and MFA](https://www.datawiza.com/blog/technical/how-to-set-up-a-private-chatgpt-instance-with-sso-and-mfa/) appeared first on [Datawiza](https://www.datawiza.com).