Search K
Appearance
Appearance
Overview Use this guide to register a Delegated Microsoft app in Azure and connect it to your system as a “Third Party (Microsoft)” OAuth account. The app enables end-users to:
- Read/write/create/delete SharePoint/OneDrive files and folders
- Read and send email from their mailbox
- Read/write Teams chats and send channel messages (where supported in delegated context)
- Read/write calendar events
This document provides the exact permissions to grant, the redirect/authorization URLs to use, and the values to enter in your application. All values below use placeholders—replace them with your own.
Sign in to Azure Portal → Microsoft Enter ID → App registrations → New registration.
Name: e.g., MinuteView (Delegated)
.
Supported account types: Choose what fits your scenario (single tenant or multi-tenant).
Redirect URI (web):
https://your-domain/MinuteView/PageGeneral/ServiceCallback.aspx
Click Register.
From the app’s Overview page:
YOUR-CLIENT-ID
YOUR-TENANT-ID
Create a Client secret:
YOUR-CLIENT-SECRET
.Go to API permissions → Add a permission → Microsoft Graph → Delegated permissions. Add:
Files.ReadWrite.All
Sites.ReadWrite.All
Mail.Read
Mail.Send
Chat.ReadWrite
Contacts.Read
ChannelMessage.Send
TeamsActivity.Send
(optional: for activity feed notifications)Note: Teams APIs in delegated context operate within the signed-in user’s membership and tenant policies. Some Teams graph operations require Application permissions; this guide is strictly for Delegated.
Calendars.ReadWrite
openid
profile
email
offline_access
When your tenant enforces admin consent, click Grant admin consent for your organization.
Authorize endpointhttps://login.microsoftonline.com/{TenantId}/oauth2/v2.0/authorize
Token endpointhttps://login.microsoftonline.com/{TenantId}/oauth2/v2.0/token
Replace
{TenantId}
with your tenant GUID orcommon
/organizations
if multi-tenant behavior is intended.
Use the Authorization Code flow. Two common patterns for scope
:
.default
scope (uses app’s configured permissions) response_type=code
scope=https://graph.microsoft.com/.default offline_access
.default
relies on the permissions you configured in API permissions, typically requires admin consent up front.
When your app receives the code
at the callback:
POST to the token endpoint with:
client_id={ClientId}
client_secret={ClientSecret}
grant_type=authorization_code
code={authorization_code_from_callback}
redirect_uri={exact_same_redirect_uri}
scope={same scope pattern used in authorize step (if needed)}
You’ll receive:
access_token
(short-lived; use for Graph calls)refresh_token
(because of offline_access
; store securely to renew access tokens)Sign in with a user who has access to the target SharePoint sites/Teams/mailbox.
Call sample endpoints to validate each capability:
GET /me/drive/root/children
and PUT /me/drive/root:/path/file.ext:/content
GET /sites/{site-id}/drive/root/children
GET /me/messages
, POST /me/sendMail
GET /me/chats
, POST /teams/{team-id}/channels/{channel-id}/messages
GET /me/events
, POST /me/events
Confirm refresh token rotation works and tokens are stored securely.
Replace placeholders and URL-encode
{redirect_uri}
.
Authorize URL (.default pattern):
https://login.microsoftonline.com/{TenantId}/oauth2/v2.0/authorize
?client_id={ClientId}
&response_type=code
&redirect_uri={UrlEncodedCallbackUrl}
&response_mode=query
&scope=https://graph.microsoft.com/.default offline_access
&state={TokenId}
Token URL:
POST https://login.microsoftonline.com/{TenantId}/oauth2/v2.0/token
Content-Type: application/x-www-form-urlencoded
client_id={ClientId}
&client_secret={ClientSecret}
&grant_type=authorization_code
&code={CodeFromAuthorizeCallback}
&redirect_uri={ExactSameCallbackUrl}
Files.ReadWrite.All
, Sites.ReadWrite.All
Mail.Read
, Mail.Send
Chat.ReadWrite
, ChannelMessage.Send
, TeamsActivity.Send
(optional)Calendars.ReadWrite
openid
, profile
, email
, offline_access
This set enables the user to read/write files in SharePoint/OneDrive, read and send email, read/write Teams chats and send channel messages (within delegated constraints), and read/write calendar events.