activities
latest
false
Importante :
Este contenido se ha localizado parcialmente a partir de un sistema de traducción automática.
Actividades de productividad
Last updated 13 de sep. de 2024

How to connect to Microsoft 365 activities

Información general

Microsoft 365 activities have different authentication flows that you can choose from. Your choice is dependent on: the type of automation mode you plan to run (attended or unattended), the type of projects you want to build (cross-platform or Windows), the type of permissions you want to grant (delegated or app-only), and your application authentication requirements (consult with your administrator if you're unsure which authentication requirements apply to your application).

Use the table below to understand the basic differences between each authentication type:
Microsoft Authentication flowMicrosoft 365 Scope - Authentication type Conexión de Integration ServiceRobot type - AttendedRobot type - UnattendedAPI permission type
OAuth 2.0 authorization code flow

Interactive Token - public app

Código de autorización OAuth 2.0docs image 

Permisos delegados

Interactive Token - BYOA Traiga su propia aplicación OAuth 2.0 docs image Permisos delegados
Integrated Windows authentication (IWA) N/D docs image

Permisos delegados

Nombre de usuario y contraseña N/D docs image

Permisos delegados

OAuth 2.0 client credentials flowApplication ID and secretN/D docs image

Permisos de la aplicación

N/D docs image

Permisos de la aplicación

Delegated permissions versus application permissions

To understand the differences between delegated and application permissions, see the Microsoft official documentation: Comparison of delegated and application permissions.

Briefly, the differences are as follows:

  • With delegated permissions, the application impersonates a user and acts on the user's behalf. The application can access only what the signed-in user can access.
  • With application permissions, the application acts on its own, without a signed-in user. The application can access any data that its permissions are associated with.

For both delegated and application permissions, you can restrict what the application can and can't access using the scopes defined when you create the app. Refer to Scopes and permissions in the Microsoft documentation.

Multitenant versus single-tenant applications

Both Microsoft 365 Scope and Integration Service connections support single tenant applications and multitenant applications. To learn the difference between the two, refer to Who can sign in to you app? in the Microsoft official documentation.

Azure environments

Both Microsoft 365 Scope and Integration Service connections support multiple Azure environments:

  • Connections through the Scope activity support: Azure, Azure Global, China, Germany or US Government. The default value is Global.
  • Connections through Integration Service support: Default, US Government L4, US Government L5, and China.

Conexiones de Integration Service

Integration Service connectors use OAuth 2.0 authorization code flow with delegated permissions.

The Microsoft 365 modern activities and triggers establish an authenticated connection to the Integration Service Microsoft OneDrive & SharePoint and the Microsoft Outlook 365 connectors. To learn more about Integration Service connections, refer to Set up Integration Service connectors.

When you connect to the Microsoft connectors in Integration Service, you have the option to use the standard UiPath public application (with a set of default, non-configurable scopes) or create your own application with Microsoft and customize the scopes you need.

Microsoft 365 Scope connections

The Microsoft 365 Classic activities establish an authenticated connection to your Microsoft 365 applications via the Microsoft 365 Scope activity.

The activities need authorization from the Microsoft identity platform. To enable authorization, you first register your Microsoft 365 application in your Azure Active Directory. When registering your application, you assign Microsoft Graph API permissions to specify the resources your Robot can access on your behalf.

After registering your Microsoft 365 application, Azure Active Directory assigns a unique application (client) ID that you enter in the Microsoft 365 Scope activity. The Application ID is used to collect the necessary information about your registered app to initiate authentication and get the access token to establish the connection.

When you add an activity to Microsoft 365 Scope, its required scopes are automatically detected. You can also choose to allow additional scopes.


docs image

Token interactivo

Información general

  • Runs: as a user.
  • Scenario: attended automation.
  • Delegated permissions.
Nota: Este es el mismo método de autenticación admitido en Integration Service, ya sea a través de la aplicación pública de UiPath o de una aplicación privada personalizada (método Trae tu propia aplicación).

Detalles

  • When registering your application, you must select an application type. For interactive token authentication, use a mobile/desktop application (which uses OAuth 2.0 authorization code flow).
  • El tipo de autenticación de token interactivo se puede utilizar para la automatización atendida y cuando se requiere la autenticación multifactor (MFA). Esta es la opción predeterminada y la que usamos en nuestros ejemplos. Si estás interesado en probar el paquete de actividades, esta opción es fácil de configurar y funciona bien para las cuentas personales (utilizando el URI de redirección predeterminado indicado en el paso 7 de la sección Registrar tu aplicación de la guía de configuración ).
  • You have the option to register and use your own Azure app (i.e., OAuthApplication = Custom) or the one provided by UiPath (OAuthApplication = UiPath).
  • When you run the Microsoft 365 activity for the first time using this authentication type, you are prompted to authorize access to the resources (you granted permissions to when registering your app) via a consent dialogue box. See Get access on behalf of a user.
  • If you select this authentication type in Microsoft 365 Scope, leave the Username, Password, and Tenant fields empty.

Autenticación de Windows integrada (IWA)

Información general

  • Runs: as a user.
  • Scenario: unattended automation.
  • Delegated permissions.
Note: This authentication type does not work when multi-factor authentication (MFA) is enabled. If your application requires MFA, you can run attended automation using the Interactive Token authentication type or unattended automation using Application ID and Secret and Application ID and Certificate. Application ID and Secret and Application ID and Certificate authentication types are appropriate for unattended automation and work regardless of whether the MFA is enabled or disabled.

Detalles

  • El tipo de autenticación Autenticación de Windows integrada puede utilizarse para la automatización desatendida. Esta opción puede aplicarse a las aplicaciones alojadas de Windows que se ejecutan en equipos unidos a un dominio de Windows o Azure Active Directory.
  • When registering your application, you must select an application type. For IWA authentication type, you must use a mobile/desktop application (which uses OAuth 2.0 authorization code flow).
  • Works only for federated users and if your registered Azure application is configured to support IWA. Doesn't work for multi-factor authentication (MFA). See details here: IWA on GitHub.
  • You should only select this option if your registered application is configured to support Integrated Windows Authentication.
  • If you select this authentication type in Microsoft 365 Scope, leave the Username and Password fields empty. The Tenant field is optional.

Nombre de usuario y contraseña

Resumen

  • Runs: as a user.
  • Scenario: unttended automation.
  • Delegated permissions.
Note: This authentication type does not work when multi-factor authentication (MFA) is enabled. If your application requires MFA, you can run attended automation using the Interactive Token authentication type or unattended automation using Application ID and Secret and Application ID and Certificate. Application ID and Secret and Application ID and Certificate authentication types are appropriate for unattended automation and work regardless of whether the MFA is enabled or disabled.

Detalles

  • This authentication type is provided only for legacy reasons. We do not recommend using this option, as it goes against the principles of modern authentication. It doesn't work for multi-factor authentication (MFA). See details here: User & Password on GitHub.
  • Aunque Microsoft no lo recomienda, puedes utilizar este tipo de autenticación en aplicaciones cliente públicas. El uso de este tipo de autenticación impone restricciones en su aplicación. Por ejemplo, las aplicaciones que usen este flujo no podrán iniciar la sesión de un usuario que necesite realizar una autenticación multifactor (acceso condicional). Tampoco permitirá que tu aplicación se beneficie del inicio de sesión único.
  • The ApplicationID property is required when selecting the Username and Password authentication type. You can register your Microsoft 365 Application using your personal, work, and/or school account.

Secreto e ID de aplicación

Resumen

  • Runs: as background service.
  • Scenario: unattended and unattended with MFA enabled.
  • Application permissions.
  • Recommended for unattended executions or when you want to access the Microsoft Graph API as an application (a background service / daemon) without a signed-in user.

Detalles

  • When registering your application, you must select an application type. For application ID and secret authentication type, use a confidential/web application (which uses OAuth 2.0 client credentials flow).

  • Los permisos de la API adecuados deben configurarse para la aplicación de Azure para que las actividades de Microsoft 365 funcionen correctamente (por ejemplo, los permisos de la aplicación Group.Create, Group.Read.All y Group.ReadWrite.All deben configurarse para Microsoft Graph cuando se utilizan actividades de Grupos).
  • A single organization can have multiple application (client) IDs for their Microsoft 365 account. Each application (client) ID contains its own permissions and authentication requirements. For example, you and your colleague can both register a Microsoft 365 application in your company's Azure Active Directory with different permissions. Your app can be configured to authorize permissions to interact with files only, while your colleague's app is configured to authorize permissions to interact with files, mail, and calendar. If you enter your application (client) ID into this property and run attended automation, the consent dialogue box would be limited to file permissions (and subsequently, only the Files activities can be used).

  • Some activities can't be used with this type of authentication because the corresponding Microsoft Graph API does not support application permissions (e.g. Find Meeting Times).
  • Para las actividades de correo electrónico, es obligatorio especificar un valor para el parámetro Cuenta (es decir, qué buzón de todos los buzones de correo de los tenant desea usar).

  • Use Sites.Selected application permission to allow the application to access just the specific SharePoint site collections rather than all.
  • When using this authentication type, the application has access to all mailboxes from your tenant, the reason being that application API permission Mail.Read means Read mail in all mailboxes and Mail.ReadWrite means Read and write mail in all mailboxes. One solution is to restrict Application permissions to specific mailboxes, so the application has access only to the specified mailboxes. For more information, see Scoping application permissions to specific Exchange Online mailboxes.

IDDeAplicación y certificado

Resumen

  • Runs: as background service.
  • Scenario: unattended and unattended with MFA enabled.
  • Application permissions.

Detalles

  • When registering your application, you must select an application type. For application ID and certificate authentication type, use a confidential/web application (which uses OAuth 2.0 client credentials flow).
  • This authentication mtehod is similar to application ID and secret, but it uses a certificate as a secret instead of a client secret string.

Using certificates

To authenticate using a certificate as a secret, take the following steps:

  1. In the the Azure portal:

    • Localiza tu aplicación de Microsoft 365 registrada.
    • Selecciona Certificados y secretos y carga tu archivo de certificado (clave pública). Puede tener uno de los siguientes tipos de archivo: .cer, .pem, .crt.


  2. Convert the raw contents of your .pfx file representing the certificate to a base64 string. You can use a web-based tool like Base64.Guru or assign the Convert.ToBase64String(System.IO.File.ReadAllBytes(pfxFilePath)) value to a String variable.
  3. In the Microsoft 365 Scope activity:
  • Set Authentication Type to Application ID and Certificate.
  • Configura CertificadoComoBase64 a la representación base64 del certificado.
  • Si se requiere una contraseña para utilizar el certificado, establece también el valor de la propiedad Contraseña del certificado .

Cómo utilizar las actividades de Microsoft 365 sin conexiones de Integration Service

Acerca de

Ahora puedes utilizar las actividades más recientes de Microsoft 365 incluso si no tienes Integration Service, a través del ámbito de Microsoft 365.

The Microsoft 365 activities designed specifically for Integration Service feature a Connection field, which enables you to choose a connection created through an Integration Service connector. When used inside Microsoft 365 Scope, the activities simply inherit the connection information from the Scope.

Matriz de tipos de autenticación y proyectos

Microsoft 365    
 NubeIn situ
 Ámbito de aplicación de Microsoft Office 365Integration ServiceÁmbito de aplicación de Microsoft Office 365Integration Service
Multiplataforma    
ID de aplicación y certificadoNo disponible No disponible No disponible No disponible
ID y secreto de la aplicaciónNo disponibleNo disponible No disponible No disponible
OAuth: BYOA available No disponibleNo disponible
OAuth: aplicación UiPathNo disponible available No disponibleNo disponible
Nombre de usuario y contraseñaNo disponible No disponibleNo disponible No disponible
Autenticación de Windows integradaNo disponible No disponible No disponible No disponible
Ventanas    
ID de aplicación y certificadoavailable No disponibleavailable No disponible
ID y secreto de la aplicaciónavailableavailable available No disponible
OAuth: BYOAavailable available available No disponible
OAuth: aplicación UiPathavailable available available No disponible
Nombre de usuario y contraseñaavailableNo disponible available No disponible
Autenticación de Windows integradaavailableNo disponible available No disponible

Métodos de conexión

Hay dos formas de configurar una conexión en la actividad Ámbito de Microsoft 365 .

Método de conexión DescripciónBeneficiosDesventajas
Activo
Nota: Recomendado.
 

Utiliza un activo de Orchestrator para almacenar la conexión junto con la configuración del ámbito.

El activo es un formato JSON.

Cada vez que se utiliza, la actividad recupera la configuración del activo.

Según la configuración del activo, el Ámbito se comporta de forma diferente; identifica el tipo de autenticación y oculta los campos innecesarios.

Si el JSON del activo no está configurado correctamente, se produce un error de validación.

Las actividades se benefician de las búsquedas en tiempo de diseño y pueden descubrir archivos, carpetas, listas, rangos y otros.

La conexión es fácilmente transferible, ya que las credenciales no se transmiten de un usuario a otro en texto sin formato.

Puede ser configurado por un administrador.

Es más seguro, porque las credenciales no llegan al flujo de trabajo de Studio.

Requiere un usuario avanzado para configurar el activo.

No es fácil de configurar por parte de un Citizen Developer.

Panel de propiedades 

Utiliza el panel de propiedades existente para configurar las credenciales de conexión.

La configuración se puede añadir en texto sin formato o mediante variables.

Más fácil de usar.

Mantiene la compatibilidad con versiones anteriores.

 
 Configuración a través de texto sin formato
Nota: No recomendado.
Configura el panel Propiedades con valores de texto sin formato.Las actividades se benefician de las búsquedas en tiempo de diseño y pueden descubrir archivos, carpetas, listas, rangos y otros. Menos seguro, porque las credenciales deben pasarse entre usuarios en texto sin formato.
 Configuración a través de variables

Configura el panel de propiedades con variables.

Más seguro, porque las credenciales no llegan al flujo de trabajo de Studio.

Las actividades no pueden descubrir ningún recurso en tiempo de diseño.

Formato de activo de ámbito de Microsoft 365

Formato de activo estándar
{
    "CertificateAsBase64": "",
    "CertificatePassword": "",
    "ClientSecret": "",
    "Environment": "Default" | "Global" | "China" | "Germany" | "USGovernment" | "USGovernmentDOD",
    "Mode": "interactive" | "integrated" | "uap" | "appidsecret" | "appidcertificate",
    "OAuth2AppData": {
        "ApplicationId": "",
        "TenantId": ""
    }
}{
    "CertificateAsBase64": "",
    "CertificatePassword": "",
    "ClientSecret": "",
    "Environment": "Default" | "Global" | "China" | "Germany" | "USGovernment" | "USGovernmentDOD",
    "Mode": "interactive" | "integrated" | "uap" | "appidsecret" | "appidcertificate",
    "OAuth2AppData": {
        "ApplicationId": "",
        "TenantId": ""
    }
}
UiPath application asset configuration
{
    "CertificateAsBase64": "",
    "CertificatePassword": "",
    "ClientSecret": "",
    "Environment": "Default",
    "Mode": "interactive" | "integrated" | "uap" | "appidsecret" | "appidcertificate",
    "OAuth2AppData": {
        "ApplicationId": "f2f43f65-16a6-4319-91b6-d2a342a88744",
        "TenantId": ""
    }
}{
    "CertificateAsBase64": "",
    "CertificatePassword": "",
    "ClientSecret": "",
    "Environment": "Default",
    "Mode": "interactive" | "integrated" | "uap" | "appidsecret" | "appidcertificate",
    "OAuth2AppData": {
        "ApplicationId": "f2f43f65-16a6-4319-91b6-d2a342a88744",
        "TenantId": ""
    }
}
Configuración de activos de aplicación personalizada
Nota: Esto es solo un ejemplo. Configura tu propia aplicación y recupera los OAuth2AppData necesarios.
{
    "CertificateAsBase64": "",
    "CertificatePassword": "",
    "ClientSecret": "",
    "Environment": "Default",
    "Mode": "interactive" | "integrated" | "uap" | "appidsecret" | "appidcertificate",
    "OAuth2AppData": {
        "ApplicationId": "d47f7253-65ae-58n5-ag04-26109734e6de",
        "TenantId": "3ce4ef03-chb1-871f-94b0-345136965f10"
    }
}{
    "CertificateAsBase64": "",
    "CertificatePassword": "",
    "ClientSecret": "",
    "Environment": "Default",
    "Mode": "interactive" | "integrated" | "uap" | "appidsecret" | "appidcertificate",
    "OAuth2AppData": {
        "ApplicationId": "d47f7253-65ae-58n5-ag04-26109734e6de",
        "TenantId": "3ce4ef03-chb1-871f-94b0-345136965f10"
    }
}

Limitaciones

Las siguientes características no están disponibles cuando se utilizan actividades dentro del ámbito de Microsoft 365: desencadenadores, vinculaciones y experiencia de anulación.

Actualización del token

No hay ningún servicio disponible para actualizar tus tokens de conexión, como el que está disponible en Integration Service.

If the Authorization Token isn't refreshed for a certain number of days, it expires, and you must re-authenticate. To avoid the expiration of authorization tokens, run a robot with that specific connection. Running an automation with the Scope activity refreshes the authorization token.

docs image
Recursos adicionales de OAuth 2.0:

¿Te ha resultado útil esta página?

Obtén la ayuda que necesitas
RPA para el aprendizaje - Cursos de automatización
Foro de la comunidad UiPath
Uipath Logo White
Confianza y seguridad
© 2005-2024 UiPath. Todos los derechos reservados.