ex_login_O365_OAuth_Graph
Login to Office 365 with OAuth by using Microsoft Graph API.
Member of namespace
EwsmailSyntax
bool ex_login_O365_OAuth_Graph (string clientId , string tenantId , string username , string password)
Parameters
- clientId
- Type: string
- tenantId
- Type: string
- username
- Type: string
- password
- Type: string
Smart parameters are supported for all parameters.
Parameters (clientId, tenantId, username, password) can be encrypted by storing it in the Advanced section of the Custom tab in the Application Manager.
To retrieve parameters that is stored in the Advanced section, use a smart parameter for the action's parameters similar to @APPVAR(values/adv/password) where password is the name entered for the value in the Application Manager.
Returns
True if the login succeeds. Otherwise, False.Level
Batch level, open event.Details
To use the authentication service that is provided by Azure Active Directory have the Administrator run the following required steps to enable support for Microsoft Graph on the Datacap system.
- Register the application with Azure Active Directory by logging in to the Microsoft Entra admin center with a Global Administrator login.
- From the Manage menu, select Authentication, set
the option Allow public client flows to Yes, and click
Save.

From the Manage menu, select .

Under Mail, check the box for Mail.ReadWrite.

Click Add Permissions.

- Click Grant admin consent to grant access to Mail.ReadWrite.
- Example:
-
ex_login_O365_OAuth_Graph("00000000-0000-0000-0000-000000000000", "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "user@organization.com", "@APPVAR(values/adv/password)") ex_scan_graph() ex_logout_graph()
If more than one login (ex_login_O365_OAuth_Graph) is used, the second action is ignored unless authentication fails, expires, or ex_logout_graph() was used before the second action disconnected.
See also
ex_login