- đ Quickstart
- đ§âđť OAuth app setup
- đ Useful links
- đ¨ API gotchas
1
Create an integration
In Nango (free signup), go to Integrations -> Configure New Integration -> Microsoft Admin. Nango doesnât provide a test OAuth app for Microsoft Admin yet. Youâll need to set up your own by following these instructions. After that, make sure to add the OAuth client ID, secret, and scopes in the integration settings in Nango.
2
Authorize Microsoft Admin
Go to Connections -> Add Test Connection -> Authorize, then log in to Microsoft Admin. Later, youâll let your users do the same directly from your app.
3
Call the Microsoft Admin API
Letâs make your first request to the Microsoft Admin (Microsoft Graph) API (fetch basic information about the root SharePoint site). Replace the placeholders below with your secret key, integration ID, and connection ID:Or fetch credentials dynamically via the Node SDK or API.
- cURL
- Node
Copy
Ask AI
curl "https://api.nango.dev/proxy/v1.0/sites/root" \
-H "Authorization: Bearer <NANGO-SECRET-KEY>" \
-H "Provider-Config-Key: <INTEGRATION-ID>" \
-H "Connection-Id: <CONNECTION-ID>"
Install Nangoâs backend SDK with
npm i @nangohq/node. Then run:Copy
Ask AI
import { Nango } from '@nangohq/node';
const nango = new Nango({ secretKey: '<NANGO-SECRET-KEY>' });
const res = await nango.get({
endpoint: '/v1.0/sites/root',
providerConfigKey: '<INTEGRATION-ID>',
connectionId: '<CONNECTION-ID>'
});
console.log(res.data);
Next step: Embed the auth flow in your app to let your users connect their Microsoft Admin accounts.
1
Create a Microsoft account and Azure account
If you donât already have them, sign up for a Microsoft account and an Azure account.
2
Register an application in Microsoft Entra ID
- Sign in to the Microsoft Entra admin center as at least an Application Developer.
- If you have access to multiple tenants, use the Settings icon in the top menu to switch to the tenant in which you want to register the application.
- From the search bar at the top of the Azure portal, search for App registrations and select it. Then choose New registration. Or from your left navigation tab, navigate to Applications > App registrations then choose New registration.
- Enter a meaningful name for your application, for example âNango Integrationâ.
- Under Supported account types you need to decide who can install your integration:
- Accounts in any organizational directory - Any user account in a professional Microsoft organization (Business, School, etc.)
- Accounts in any organizational directory and personal Microsoft accounts - The accounts from the first option, plus personal Microsoft accounts (pick this unless you want to restrict your integration to business accounts)
- Leave the Redirect URI section blank for now; weâll configure it in a later step.
- Click Register to complete the app registration.
3
Note your application (client) ID
After registration, youâll be taken to the applicationâs Overview page. Record the Application (client) ID, which uniquely identifies your application and is used in your applicationâs code as part of validating security tokens.
4
Add a redirect URI
- In the left sidebar, select Authentication.
- Under Platform configurations, select Add a platform.
- Select Web as the platform type.
- Enter
https://api.nango.dev/oauth/callbackas the Redirect URI. - Under Advanced settings, keep Allow public client flows set to the default No for web applications.
- Click Configure to save your changes.
5
Add API permissions
- In the left sidebar, select API permissions.
- Click Add a permission.
- Select Microsoft Graph to integrate with Microsoft Admin.
- Select the required permissions from the Application permissions section.
- Select the specific permissions your app requires. Please refer to the table below for some of the commonly used scopes.
- Click Add permissions.
- If your application requires admin consent, click Grant admin consent for [tenant] to pre-authorize the permissions.
6
Create a client secret
- In the left sidebar, select Certificates & secrets.
- Under Client secrets, click New client secret.
- Enter a description for the secret and select an expiration period (6 months, 12 months, 24 months, or custom). Please select a date further in the future to avoid interruptions, note that the Custom date can only be set to a maximum of 1 year from the current date. If the secret expires, you will need to regenerate a new one and update your integration within Nango.
- Click Add.
- Important: Copy the secret value immediately and store it securely. You wonât be able to see it again after you leave this page.
7
Configure token settings (optional)
- In the left sidebar, select Token configuration. Here you can configure optional claims to be included in the access tokens issued for your application.
- Click Add optional claim and select the claims you want to include in your access tokens.
8
Configure app visibility (optional)
If you want users to see your app on their My Apps page:
- From the search bar at the top of the Azure portal, search for Enterprise applications, select it, and then choose your app.
- On the Properties page, set Visible to users? to Yes.
9
Next
Follow the Quickstart.
Common Scopes
| Scope | Description |
|---|---|
Sites.Read.All | Read items in all site collections |
Sites.ReadWrite.All | Read and write items in all site collections |
Files.Read.All | Read all files in all site collections and drives |
Files.ReadWrite.All | Read and write all files in all site collections/drives |
User.Read.All | Read all user profiles in the organization |
Directory.Read.All | Read directory data across the organization |
Useful links
Contribute useful links by editing this page
- Only organization administrators can authorize this integration, as admin consent is required to grant permissions for the entire organization.
- You can find the permissions required for each API call in its corresponding API method section. For example, to retrieve a user from Teams, refer to the Application permission type in the Get a user permissions documentation.
- Microsoft offers a tool that allows you to construct and perform Graph API queries and see their response for any apps on which you have an admin, developer, or tester role. For more information you can check Microsoft Graph Explorer.
- Please be aware that the Microsoft Graph API implements throttling to manage the volume of requests. For more information on handling throttling, refer to the Microsoft Graph Throttling Guidance.
- Microsoft Graph API has different versions (v1.0 and beta). The v1.0 endpoint is for production use, while the beta endpoint contains features that are still in preview.
- You can set the
.defaultscope documentation to ensure the permissions remain the same as those granted at the organization level. - The
.defaultscope canât be combined with the scopes registered in the Azure portal. So either just use the.defaultscope or remove it to list out explicit parameters that are required. If you attempt to combine them youâll receive the following error
Copy
Ask AI
.default scope can't be combined with resource-specific scopes
Contribute API gotchas by editing this page
Questions? Join us in the Slack community.