Create a Microsoft OAuth app for OpenConnector
Use a Microsoft Entra app registration when OpenConnector needs to connect Microsoft Graph providers such as Outlook, OneDrive, or Excel.
OpenConnector services
| Service ID | Provider | Extra client field |
|---|---|---|
outlook | Outlook | tenant |
one_drive | OneDrive | tenant |
excel | Excel | tenant |
The tenant value is the Microsoft identity platform tenant segment used in the authorization and token URLs. Common values are common, organizations, consumers, or a specific tenant ID.
Prerequisites
- A running OpenConnector runtime.
- Access to Microsoft Entra admin center or Azure app registrations.
- Permission to register an app and create a client secret.
- The OpenConnector origin users open in the browser, such as
http://localhost:3000orhttps://connect.example.com.
Step 1: Set the OpenConnector callback URL
Build the callback URL by appending /oauth/callback to your OpenConnector origin. For local testing, use http://localhost:3000/oauth/callback. For a public deployment, set OOMOL_CONNECT_ORIGIN, restart OpenConnector, and use the public callback URL, such as https://connect.example.com/oauth/callback.
Step 2: Register a Microsoft app
In Microsoft Entra admin center:
- Open App registrations.
- Create a new registration.
- Choose the supported account type that matches your users.
- Add a Web redirect URI with the exact OpenConnector callback URL.
- Register the app.
- Open Certificates & secrets and create a client secret.
- Open API permissions and add the delegated Microsoft Graph permissions required by the OpenConnector service.
Microsoft’s official guide is Register an application with the Microsoft identity platform. Microsoft also documents that the redirect URI sent in the auth request must match a registered redirect URI in the authorization code flow.
Step 3: Copy the client values
| Microsoft value | OpenConnector field |
|---|---|
| Application client ID | clientId |
| Client secret value | clientSecret |
| Tenant segment | extra.tenant |
Copy the client secret value when it is created. Microsoft will not show the full secret value again later.
Step 4: Save the client in OpenConnector
OpenConnector’s Microsoft providers require the extra tenant value. Use an OpenConnector console version that shows the tenant field in the OAuth client form before following this guide.
- Open the OpenConnector web console, such as
http://localhost:3000. - Open Providers and select Outlook, OneDrive, or Excel.
- Choose Configure OAuth Client or Edit OAuth Client.
- Paste the Microsoft application client ID and client secret value.
- Fill Tenant with
common,organizations,consumers, or your tenant ID. - Choose Save OAuth Client.
Repeat these steps for one_drive or excel when configuring those services.
Step 5: Connect and test
After saving the OAuth client config, choose Connect on the Microsoft provider page. Sign in with the Microsoft account, approve consent, return to OpenConnector, and confirm that the provider page shows the account as connected.
Use the console action details before running Microsoft Graph actions. If outlook.list_messages is not available in your catalog version, choose another read action shown for the provider.
Troubleshooting
| Symptom | What to check |
|---|---|
| Microsoft says the redirect URI is invalid | Add the exact <openconnector-origin>/oauth/callback URL as a Web redirect URI in the app registration. |
| Sign-in fails for the target user | Check the app’s supported account type and the tenant value saved in OpenConnector. |
| Admin consent is required | Some Microsoft Graph permissions or tenant policies require administrator consent. Ask a tenant admin to review the app. |
| Token request fails | Confirm the client secret value is current and not the secret ID. |
| Actions fail with missing permissions | Add the required delegated API permissions, grant consent, and reconnect the Microsoft account. |