Documentation Index
Fetch the complete documentation index at: https://nango.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
Create an integration
In Nango (free signup), go to Integrations -> Configure New Integration -> OneDrive Personal. Nango doesnât provide a test OAuth app for OneDrive Personal 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. Authorize OneDrive
Go to Connections -> Add Test Connection -> Authorize, then log in to your OneDrive Personal account. Later, youâll let your users do the same directly from your app. Call the OneDrive API
Letâs make your first request to the OneDrive API (get drive information). Replace the placeholders below with your secret key, integration ID, and connection ID:curl "https://api.nango.dev/proxy/v1.0/drive" \
-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:import { Nango } from '@nangohq/node';
const nango = new Nango({ secretKey: '<NANGO-SECRET-KEY>' });
const res = await nango.get({
endpoint: '/v1.0/drive',
providerConfigKey: '<INTEGRATION-ID>',
connectionId: '<CONNECTION-ID>'
});
console.log(JSON.stringify(res.data, null, 2));
Or fetch credentials dynamically via the Node SDK or API. â
Youâre connected! Check the Logs tab in Nango to inspect requests.Create a Microsoft account and Azure account
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, select the appropriate option based on your needs:
- Personal Microsoft accounts only - For apps that only need to access OneDrive Personal accounts.
- Accounts in any organizational directory and personal Microsoft accounts - For multitenant apps that support both organizational and personal Microsoft accounts.
- Leave the Redirect URI section blank for now; weâll configure it in a later step.
- Click Register to complete the app registration.
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.
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/callback as the Redirect URI.
- Under Implicit grant and hybrid flows, check the boxes for Access tokens and ID tokens if your application needs them.
- Under Advanced settings, set Allow public client flows to No for web applications.
- Click Configure to save your changes.
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).
- 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.
Common Scopes
| Scope | Description |
|---|
OneDrive.Read | Read the signed-in userâs OneDrive files |
OneDrive.ReadWrite | Read and write the signed-in userâs OneDrive files |
OneDrive.AppFolder | Read and write files in the applicationâs special OneDrive folder |
offline_access | Access to refresh tokens for offline access |
Complete Integration Implementation
For a complete, production-ready implementation of OneDrive Personal integration with Nango, check out the Nango Sample App.The sample app provides:
- Full OAuth flow implementation
- OneDrive file picker integration
- File syncing with webhooks
- File download functionality
- Complete frontend and backend code examples
You can also watch a demo video walkthrough or view the GitHub repository.The sample app is the fastest way to get started with OneDrive Personal integration. It includes all the code you need and can be customized for your specific use case.
- Make sure you request the
offline_access scope to get a refresh token and keep access with your integration.
- OneDrive Personal uses
https://api.onedrive.com as its base URL for API calls.
- If you need a user to reauthenticate or accept updated scopes, you can force a prompt using the
authorization_params. Use prompt=login to force the user to enter their credentials (bypassing single sign-on) or prompt=consent to trigger the OAuth consent dialog after sign-in, which asks the user to grant permissions to the app. For more details, see Microsoftâs OAuth 2.0 authorization documentation.
const { data } = await nango.createConnectSession({
[...],
integrations_config_defaults: {
"one-drive-personal": {
authorization_params: {
"prompt": "consent" // or "login" depending on your needs
}
}
}
});