Outlook Mail (Office 365) Connector
Documentation
Version: 3
Documentation

Authentication User Credentials


Description

Use delegated access (User Credentials) whenever you want to let a signed-in user work with their own resources or resources they can access. Whether it's an admin setting up policies for their entire organization or a user deleting an email in their inbox, all scenarios involving user actions should use delegated access. [API reference]

Instructions

Follow these simple steps below to create Microsoft Entra ID application with delegated access:

WARNING: If you are planning to automate processes, we recommend that you use a Application Credentials authentication method. In case, you still need to use User Credentials, then make sure you use a system/generic account (e.g. automation@my-company.com). When you use a personal account which is tied to a specific employee profile and that employee leaves the company, the token may become invalid and any automated processes using that token will start to fail.
  1. Navigate to the Azure Portal and log in using your credentials.
  2. Access Microsoft Entra ID.
  3. Register a new application by going to App registrations and clicking on New registration button: Start new app registration in Microsoft Entra ID
    INFO: Find more information on how to register an application in Graph API reference.
  4. When configuration window opens, configure these fields:
    • Supported account type
      • Use Accounts in this organizational directory only, if you need access to data in your organization only.
    • Redirect URI:
      • Set the type to Public client/native (mobile & desktop).
      • Use https://zappysys.com/oauth as the URL.
    Register app in Microsoft Entra ID
  5. After registering the app, copy the Application (client) ID for later: Copy client ID of Microsoft Entra ID app
  6. Then copy OAuth authorization endpoint (v2) & OAuth token endpoint (v2) URLs to use later in the configuration: Copy Auth and Token URLs in Microsoft Entra ID app
  7. Now go to SSIS package or ODBC data source and use the copied values in User Credentials authentication configuration:
    • In the Authorization URL field paste the OAuth authorization endpoint (v2) URL value you copied in the previous step.
    • In the Token URL field paste the OAuth token endpoint (v2) URL value you copied in the previous step.
    • In the Client ID field paste the Application (client) ID value you copied in the previous step.
    • In the Scope field use the default value or select individual scopes, e.g.:
      • email
      • offline_access
      • openid
      • profile
      • Mail.Read
      • Mail.Read.Shared
      • Mail.ReadBasic
      • Mail.ReadBasic.Shared
      • Mail.ReadWrite
      • Mail.ReadWrite.Shared
      • Mail.Send
      • Mail.Send.Shared
      • User.Read
      • User.ReadBasic.All
  8. Press Generate Token button to generate Access and Refresh Tokens.
  9. Optional step. Choose Default User Id from the drop down menu (if someone shared a mailbox with you).
  10. Click Test Connection to confirm the connection is working.
  11. Done! Now you are ready to use the API Connector!

Parameters

Parameter Label Required Default value Options Description
AuthUrl Authorization URL YES
Name Value
For Single-Tenant Use https://login.microsoftonline.com/{ENTER-TENANT-ID-HERE}/oauth2/v2.0/authorize
For Multi-Tenant Use https://login.microsoftonline.com/common/oauth2/v2.0/authorize
TokenUrl Token URL YES
Name Value
For Single-Tenant Use https://login.microsoftonline.com/{ENTER-TENANT-ID-HERE}/oauth2/v2.0/token
For Multi-Tenant Use https://login.microsoftonline.com/common/oauth2/v2.0/token
ClientId Client ID YES
Scope Scope YES offline_access~email~Mail.Read~Mail.Read.Shared~Mail.ReadBasic~Mail.ReadBasic.Shared~openid~profile~User.Read~User.ReadBasic.All~Mail.ReadWrite~Mail.ReadWrite.Shared~Mail.Send~Mail.Send.Shared~
Name Value
offline_access offline_access
email email
Mail.Read Mail.Read
Mail.Read.Shared Mail.Read.Shared
Mail.ReadBasic Mail.ReadBasic
Mail.ReadBasic.Shared Mail.ReadBasic.Shared
openid openid
profile profile
User.Read User.Read
User.ReadBasic.All User.ReadBasic.All
Mail.ReadWrite Mail.ReadWrite
Mail.ReadWrite.Shared Mail.ReadWrite.Shared
Mail.Send Mail.Send
Mail.Send.Shared Mail.Send.Shared
Permissions you want to use.
ReturnUrl Return URL YES https://zappysys.com/oauth
Name Value
https://zappysys.com/oauth https://zappysys.com/oauth
ClientSecret Client Secret
RefreshTokenFilePath Refresh Token File Path If you cant fit long refresh token in ConnectionString from your program then use this. Supply three properties in json format (i.e. save this in file { "access_token": "YOUR_ACCESS_TOKEN", "refresh_token": "YOUR_REFRESH_TOKEN", "expires_in": 3600 } )
ExtraAttributesForAuthRequest Login Prompt Option
Name Value
None
Force login prompt prompt=login
Force permission select prompt=consent
Choose this if you want to force login prompt or permission prompt.
UserId Default User Id (Select after clicking **Generate Token**) me The Microsoft Mail user ID GUID or email address for the account to read messages from. (Examples: '4ff54a77-9c09-4274-958f-83bdc0a53900' or 'first.last@domain.com')
RetryMode RetryMode RetryWhenStatusCodeMatch
Name Value
None None
RetryAny RetryAny
RetryWhenStatusCodeMatch RetryWhenStatusCodeMatch
RetryStatusCodeList RetryStatusCodeList 429|503
RetryCountMax RetryCountMax 5
RetryMultiplyWaitTime RetryMultiplyWaitTime True