如何:使用多租户应用程序模式让任何 Azure Active Directory 用户登录How to: Sign in any Azure Active Directory user using the multi-tenant application pattern

如果你向许多组织提供软件即服务 (SaaS) 应用程序,则可以将应用程序配置为接受来自任何 Azure Active Directory (Azure AD) 租户的登录。If you offer a Software as a Service (SaaS) application to many organizations, you can configure your application to accept sign-ins from any Azure Active Directory (Azure AD) tenant. 此配置称为使应用程序成为多租户应用程序 。This configuration is called making your application multi-tenant. 任何 Azure AD 租户中的用户在同意配合应用程序使用其帐户之后,便可登录到应用程序。Users in any Azure AD tenant will be able to sign in to your application after consenting to use their account with your application.

如果现有应用程序具有自己的帐户系统,或者支持来自其他云提供程序的其他类型的登录,则从任何租户添加 Azure AD 登录都非常简单。If you have an existing application that has its own account system, or supports other kinds of sign-ins from other cloud providers, adding Azure AD sign-in from any tenant is simple. 只需要注册应用,通过 OAuth2、OpenID Connect 或 SAML 添加登录代码,并按下应用程序中的“使用 Microsoft 登录”按钮Just register your app, add sign-in code via OAuth2, OpenID Connect, or SAML, and put a "Sign in with Microsoft" button in your application.

Note

本文假设已熟悉如何为 Azure AD 构建单租户应用程序。This article assumes you’re already familiar with building a single tenant application for Azure AD. 如果不是,则从开发人员指南主页上其中一个快速入门开始。If you’re not, start with one of the quickstarts on the developer guide homepage.

将应用程序转换成 Azure AD 多租户应用包括四个简单的步骤:There are four simple steps to convert your application into an Azure AD multi-tenant app:

  1. 将应用程序注册更新为多租户Update your application registration to be multi-tenant
  2. 将代码更新为向 /common 终结点发送请求Update your code to send requests to the /common endpoint
  3. 将代码更新为处理多个颁发者值Update your code to handle multiple issuer values
  4. 了解用户和管理员的同意意向并进行适当的代码更改Understand user and admin consent and make appropriate code changes

让我们详细了解每个步骤。Let’s look at each step in detail. 也可以直接跳转到此多租户示例列表You can also jump straight to this list of multi-tenant samples.

将注册更新为多租户Update registration to be multi-tenant

Azure AD 中的 Web 应用/API 注册默认为单租户。By default, web app/API registrations in Azure AD are single tenant. 通过在 Azure 门户中应用程序注册的“身份验证” 窗格中查找“支持的帐户类型” 开关,并将其设置为“任何组织目录中的帐户” ,可以使注册成为多租户。You can make your registration multi-tenant by finding the Supported account types switch on the Authentication pane of your application registration in the Azure portal and setting it to Accounts in any organizational directory.

在将某个应用程序转换为多租户之前,Azure AD 要求该应用程序的应用 ID URI 全局唯一。Before an application can be made multi-tenant, Azure AD requires the App ID URI of the application to be globally unique. 应用 ID URI 是在协议消息中标识应用程序的方式之一。The App ID URI is one of the ways an application is identified in protocol messages. 就单租户应用程序而言,应用 ID URI 在该租户中保持唯一便已足够。For a single tenant application, it is sufficient for the App ID URI to be unique within that tenant. 就多租户应用程序而言,该 URI 必须全局唯一,以便 Azure AD 能够在所有租户中找到该应用程序。For a multi-tenant application, it must be globally unique so Azure AD can find the application across all tenants. 系统通过要求应用 ID URI 必须具有与已验证 Azure AD 租户域匹配的主机名,来强制实施全局唯一性。Global uniqueness is enforced by requiring the App ID URI to have a host name that matches a verified domain of the Azure AD tenant.

默认情况下,通过 Azure 门户创建的应用在创建应用时设置了一个全局唯一的应用 ID URI,但你可以更改此值。By default, apps created via the Azure portal have a globally unique App ID URI set on app creation, but you can change this value. 例如,如果租户的名称为 contoso.onmicrosoft.com,则有效的应用 ID URI 为 https://contoso.partner.onmschina.cn/myappFor example, if the name of your tenant was contoso.partner.onmschina.cn then a valid App ID URI would be https://contoso.partner.onmschina.cn/myapp. 如果租户具有已验证的域 contoso.com,则有效的应用 ID URI 也是 https://contoso.com/myappIf your tenant had a verified domain of contoso.com, then a valid App ID URI would also be https://contoso.com/myapp. 如果应用程序 ID URI 不遵循此模式,则将应用程序设置为多租户就会失败。If the App ID URI doesn’t follow this pattern, setting an application as multi-tenant fails.

Note

默认情况下,本机客户端注册以及 Microsoft 标识平台应用程序是多租户的。Native client registrations as well as Microsoft identity platform applications are multi-tenant by default. 不需要采取任何措施将这些应用程序注册转换为多租户。You don’t need to take any action to make these application registrations multi-tenant.

将代码更新为向 /common 发送请求Update your code to send requests to /common

在单租户应用程序中,登录请求将发送到租户的登录终结点。In a single tenant application, sign-in requests are sent to the tenant’s sign-in endpoint. 以 contoso.partner.onmschina.cn 为例,终结点将是:https://login.partner.microsoftonline.cn/contoso.partner.onmschina.cnFor example, for contoso.partner.onmschina.cn the endpoint would be: https://login.partner.microsoftonline.cn/contoso.partner.onmschina.cn. 发送到租户终结点的请求可以让该租户中的用户(或来宾)登录该租户中的应用程序。Requests sent to a tenant’s endpoint can sign in users (or guests) in that tenant to applications in that tenant.

使用多租户应用程序时,应用程序事先并不知道用户来自哪个租户,因此无法将请求发送到租户的终结点。With a multi-tenant application, the application doesn’t know up front what tenant the user is from, so you can’t send requests to a tenant’s endpoint. 取而代之的是,请求将发送到在所有 Azure AD 租户之间多路复用的终结点:https://login.partner.microsoftonline.cn/commonInstead, requests are sent to an endpoint that multiplexes across all Azure AD tenants: https://login.partner.microsoftonline.cn/common

当 Microsoft 标识平台在 /common 终结点上收到请求时,会使用户登录,因而可以发现用户来自哪个租户。When Microsoft identity platform receives a request on the /common endpoint, it signs the user in and, as a consequence, discovers which tenant the user is from. /common 终结点可与 Azure AD 支持的所有身份验证协议配合使用:OpenID Connect、OAuth 2.0、SAML 2.0 和 WS 联合身份验证。The /common endpoint works with all of the authentication protocols supported by the Azure AD: OpenID Connect, OAuth 2.0, SAML 2.0, and WS-Federation.

然后,对应用程序做出的登录响应会包含代表该用户的令牌。The sign-in response to the application then contains a token representing the user. 令牌中的颁发者值告知应用程序该用户来自哪个租户。The issuer value in the token tells an application what tenant the user is from. 从 /common 终结点返回响应时,令牌中的颁发者值将与用户的租户相对应。When a response returns from the /common endpoint, the issuer value in the token corresponds to the user’s tenant.

Important

/common 终结点不是租户,也不是颁发者,而只是一个多路复用器。The /common endpoint is not a tenant and is not an issuer, it’s just a multiplexer. 使用 /common 时,需要更新应用程序中用于验证令牌的逻辑,以便考虑到这一点。When using /common, the logic in your application to validate tokens needs to be updated to take this into account.

将代码更新为处理多个颁发者值Update your code to handle multiple issuer values

Web 应用程序和 Web API 接收并验证 Microsoft 标识平台发送的令牌。Web applications and web APIs receive and validate tokens from Microsoft identity platform.

Note

尽管本机客户端应用程序从 Microsoft 标识平台请求并接收令牌,但它们这样做是为了将令牌发送到 API 来进行验证。While native client applications request and receive tokens from Microsoft identity platform, they do so to send them to APIs, where they are validated. 本机应用程序不会验证令牌,并且必须将它们视为不透明。Native applications do not validate tokens and must treat them as opaque.

让我们看看应用程序如何验证它从 Microsoft 标识平台接收的令牌。Let’s look at how an application validates tokens it receives from Microsoft identity platform. 单租户应用程序通常采用类似于下面的终结点值:A single tenant application normally takes an endpoint value like:

https://login.partner.microsoftonline.cn/contoso.partner.onmschina.cn

并使用该值构造元数据 URL(在本例中为 OpenID Connect),例如:and uses it to construct a metadata URL (in this case, OpenID Connect) like:

https://login.partner.microsoftonline.cn/contoso.partner.onmschina.cn/.well-known/openid-configuration

以下载用于验证令牌的两项关键信息:租户的签名密钥和颁发者值。to download two critical pieces of information that are used to validate tokens: the tenant’s signing keys and issuer value. 每个 Azure AD 租户使用以下格式的唯一颁发者值:Each Azure AD tenant has a unique issuer value of the form:

https://sts.chinacloudapi.cn/31537af4-6d77-4bb9-a681-d2394888ea26/

其中,GUID 值是租户的租户 ID 重命名安全版本。where the GUID value is the rename-safe version of the tenant ID of the tenant. 如果选择上面的 contoso.partner.onmschina.cn 元数据链接,就可以在文档中看到此颁发者值。If you select the preceding metadata link for contoso.partner.onmschina.cn, you can see this issuer value in the document.

单租户应用程序对令牌进行验证时,它将对照来自元数据文档的签名密钥检查令牌的签名。When a single tenant application validates a token, it checks the signature of the token against the signing keys from the metadata document. 此测试使得它可以确保令牌中的颁发者值与在元数据文档中找到的颁发者值相匹配。This test allows it to make sure the issuer value in the token matches the one that was found in the metadata document.

由于 /common 终结点既不对应于租户也不是颁发者,因此在检查 /common 的元数据中的颁发者值时,它具有的是一个模板化的 URL 而不是实际值:Because the /common endpoint doesn’t correspond to a tenant and isn’t an issuer, when you examine the issuer value in the metadata for /common it has a templated URL instead of an actual value:

https://sts.chinacloudapi.cn/{tenantid}/

因此,多租户应用程序无法仅通过将元数据中的颁发者值与令牌中的 issuer 值进行匹配来验证令牌。Therefore, a multi-tenant application can’t validate tokens just by matching the issuer value in the metadata with the issuer value in the token. 多租户应用程序需要一个逻辑来根据颁发者值的租户 ID 部分来确定哪些颁发者值有效、哪些颁发者值无效。A multi-tenant application needs logic to decide which issuer values are valid and which are not based on the tenant ID portion of the issuer value.

例如,如果多租户应用程序只允许从已注册其服务的特定租户登录,则必须检查令牌中的颁发者值或 tid 声明值,以确保该租户在其订户列表中。For example, if a multi-tenant application only allows sign-in from specific tenants who have signed up for their service, then it must check either the issuer value or the tid claim value in the token to make sure that tenant is in their list of subscribers. 如果多租户应用程序只处理个人而不根据租户做出任何访问决策,则可以完全忽略颁发者值。If a multi-tenant application only deals with individuals and doesn’t make any access decisions based on tenants, then it can ignore the issuer value altogether.

多租户示例中,为了使任何 Azure AD 租户都能登录,已禁用颁发者验证。In the multi-tenant samples, issuer validation is disabled to enable any Azure AD tenant to sign in.

若要让用户登录 Azuer AD 中的某个应用程序,必须以用户租户的形式表示该应用程序。For a user to sign in to an application in Azure AD, the application must be represented in the user’s tenant. 这样,组织便可以采取一些措施,例如,当其租户中的用户登录应用程序时应用唯一策略。This allows the organization to do things like apply unique policies when users from their tenant sign in to the application. 对于单租户应用程序,此注册过程相当简单,它与在 Azure 门户中注册应用程序时的过程相同。For a single tenant application, this registration is simple; it’s the one that happens when you register the application in the Azure portal.

对于多租户应用程序,应用程序的初始注册过程是在开发人员使用的 Azure AD 租户中进行的。For a multi-tenant application, the initial registration for the application lives in the Azure AD tenant used by the developer. 当来自不同租户的用户首次登录应用程序时,Azure AD 会要求他们同意应用程序所请求的权限。When a user from a different tenant signs in to the application for the first time, Azure AD asks them to consent to the permissions requested by the application. 如果他们同意,系统将在用户的租户中创建一个称为“服务主体” 的应用程序表示形式,然后登录即可继续进行。If they consent, then a representation of the application called a service principal is created in the user’s tenant, and sign-in can continue. 系统还会在记录用户对应用程序的同意意向的目录中创建委托。A delegation is also created in the directory that records the user’s consent to the application. 有关应用程序的 Application 和 ServicePrincipal 对象以及它们之间关系的详细信息,请参阅应用程序对象和服务主体对象For details on the application's Application and ServicePrincipal objects, and how they relate to each other, see Application objects and service principal objects.

同意单层应用

这种同意体验受应用程序请求的权限的影响。This consent experience is affected by the permissions requested by the application. Microsoft 标识平台支持两种类型的权限:仅限应用的权限和委托的权限。Microsoft identity platform supports two kinds of permissions, app-only and delegated.

  • 委托的权限授权应用程序充当登录用户来执行该用户所能执行的一部分操作。A delegated permission grants an application the ability to act as a signed in user for a subset of the things the user can do. 例如,可以向应用程序授予委托的权限来读取登录用户的日历。For example, you can grant an application the delegated permission to read the signed in user’s calendar.
  • 仅限应用的权限直接授予给应用程序的标识。An app-only permission is granted directly to the identity of the application. 例如,可以向应用程序授予仅限应用的权限来读取租户中的用户列表,无论是谁登录此应用程序,该应用程序都能够执行此操作。For example, you can grant an application the app-only permission to read the list of users in a tenant, regardless of who is signed in to the application.

有些权限可由普通用户同意,有些则需要租户管理员同意。Some permissions can be consented to by a regular user, while others require a tenant administrator’s consent.

仅限应用的权限始终需要租户管理员的同意。App-only permissions always require a tenant administrator’s consent. 如果应用程序请求仅限应用的权限,当用户尝试登录应用程序时,会显示一条错误消息,指出该用户无法同意。If your application requests an app-only permission and a user tries to sign in to the application, an error message is displayed saying the user isn’t able to consent.

有些委托的权限也需要租户管理员的同意。Certain delegated permissions also require a tenant administrator’s consent. 例如,若要能够以登录用户身份写回 Azure AD,就需要租户管理员的同意。For example, the ability to write back to Azure AD as the signed in user requires a tenant administrator’s consent. 与仅限应用的权限一样,如果普通用户尝试登录请求委托权限的应用程序,而该权限需要管理员同意,则应用程序会收到错误。Like app-only permissions, if an ordinary user tries to sign in to an application that requests a delegated permission that requires administrator consent, your application receives an error. 权限是否需要管理员同意是由发布资源的开发人员决定的,可以在该资源的文档中找到相关信息。Whether a permission requires admin consent is determined by the developer that published the resource, and can be found in the documentation for the resource. Azure AD Graph API and Microsoft Graph API 的权限文档指示哪些权限需要管理员同意。The permissions documentation for the Azure AD Graph API and Microsoft Graph API indicate which permissions require admin consent.

如果应用程序使用需要管理员同意的权限,你需要提供某种表示,例如可供管理员发起操作的按钮或链接。If your application uses permissions that require admin consent, you need to have a gesture such as a button or link where the admin can initiate the action. 应用程序针对此操作发送的请求是一个普通的 OAuth2/OpenID Connect 授权请求,但此请求同时也包含 prompt=admin_consent 查询字符串参数。The request your application sends for this action is the usual OAuth2/OpenID Connect authorization request that also includes the prompt=admin_consent query string parameter. 在管理员同意且系统已在客户的租户中创建服务主体之后,后续登录请求就不再需要 prompt=admin_consent 参数。Once the admin has consented and the service principal is created in the customer’s tenant, subsequent sign-in requests do not need the prompt=admin_consent parameter. 由于管理员已确定可接受请求的权限,因此从该时间点之后,不再提示租户中的任何其他用户同意。Since the administrator has decided the requested permissions are acceptable, no other users in the tenant are prompted for consent from that point forward.

租户管理员可以禁用普通用户同意应用程序的能力。A tenant administrator can disable the ability for regular users to consent to applications. 如果禁用此功能,则始终需要管理员同意,才能在租户中使用应用程序。If this capability is disabled, admin consent is always required for the application to be used in the tenant. 若要在禁用最终用户许可的情况下测试应用程序,可以在 Azure 门户的“企业应用程序”下的 用户设置 部分中找到配置开关。If you want to test your application with end-user consent disabled, you can find the configuration switch in the Azure portal in the User settings section under Enterprise applications.

prompt=admin_consent 参数还可以由请求权限但不要求管理员同意的应用程序使用。The prompt=admin_consent parameter can also be used by applications that request permissions that do not require admin consent. 何时会使用此功能的一个示例是当应用程序需要如下所述的体验时,即:租户管理员“注册”一次,在此之后不再提示其他用户确认同意。An example of when this would be used is if the application requires an experience where the tenant admin “signs up” one time, and no other users are prompted for consent from that point on.

如果某个应用程序需要管理员同意并且管理员登录而没有发送 prompt=admin_consent 参数,则当管理员成功地向该应用程序表示同意时,它仅适用于其用户帐户If an application requires admin consent and an admin signs in without the prompt=admin_consent parameter being sent, when the admin successfully consents to the application it will apply only for their user account. 普通用户仍然无法登录或同意该应用程序。Regular users will still not be able to sign in or consent to the application. 如果想要让租户管理员浏览应用程序,然后允许其他用户访问,则此功能就很有用。This feature is useful if you want to give the tenant administrator the ability to explore your application before allowing other users access.

Note

某些应用程序想要提供一种体验,让普通用户能够一开始即表示同意,应用程序可让管理员参与操作并请求需要管理员同意的权限。Some applications want an experience where regular users are able to consent initially, and later the application can involve the administrator and request permissions that require admin consent. 当前 Azure AD 中的 v1.0 应用程序注册没有办法做到这一点;但是,使用 Microsoft 标识平台 (v2.0) 终结点允许应用程序在运行时(而不是在注册时)请求权限,从而启用此方案。There is no way to do this with a v1.0 application registration in Azure AD today; however, using the Microsoft identity platform (v2.0) endpoint allows applications to request permissions at runtime instead of at registration time, which enables this scenario. 有关详细信息,请参阅 Microsoft 标识平台终结点For more information, see Microsoft identity platform endpoint.

应用程序可能有多个层,每一层由其自身在 Azure AD 中的注册来表示。Your application may have multiple tiers, each represented by its own registration in Azure AD. 例如,一个调用 Web API 的本机应用程序,或者一个调用 Web API 的 Web 应用程序。For example, a native application that calls a web API, or a web application that calls a web API. 在这两种情况下,客户端(本机应用或 Web 应用)将请求调用资源 (Web API) 的权限。In both of these cases, the client (native app or web app) requests permissions to call the resource (web API). 要让客户端成功获得客户同意添加到其租户中,请求权限的所有资源必须都已在于客户的租户中。For the client to be successfully consented into a customer’s tenant, all resources to which it requests permissions must already exist in the customer’s tenant. 如果不符合此条件,Azuer AD 将返回错误,指出必须先添加资源。If this condition isn’t met, Azure AD returns an error that the resource must be added first.

单个租户中的多个层Multiple tiers in a single tenant

如果逻辑应用程序包含两个或更多个应用程序注册(例如独立的客户端和资源),这可能造成问题。This can be a problem if your logical application consists of two or more application registrations, for example a separate client and resource. 如何先将资源添加到客户租户中?How do you get the resource into the customer tenant first? Azure AD 通过实现在单个步骤中连接客户端和资源来涵盖了此情况。Azure AD covers this case by enabling client and resource to be consented in a single step. 用户在同意页面上会看到由客户端和资源请求的权限的总和。The user sees the sum total of the permissions requested by both the client and resource on the consent page. 若要启用此行为,资源的应用程序注册必须在其应用程序清单中以 knownClientApplications 形式包含客户端的应用 ID。To enable this behavior, the resource’s application registration must include the client’s App ID as a knownClientApplications in its application manifest. 例如:For example:

knownClientApplications": ["94da0930-763f-45c7-8d26-04d5938baab2"]

在本文末尾的相关内容部分的多层本机客户端调用 Web API 示例中对此进行了演示。This is demonstrated in a multi-tier native client calling web API sample in the Related content section at the end of this article. 下图针对在单个租户中注册的多层应用提供了同意概览。The following diagram provides an overview of consent for a multi-tier app registered in a single tenant.

同意已知的多层客户端应用

多个租户中的多个层Multiple tiers in multiple tenants

如果在不同的租户中注册不同的应用程序层,将发生类似的情况。A similar case happens if the different tiers of an application are registered in different tenants. 例如,考虑构建一个调用 Office 365 Exchange Online API 的本机客户端应用程序的情况。For example, consider the case of building a native client application that calls the Office 365 Exchange Online API. 如果要开发该本机应用程序,并让该本机应用程序在客户的租户中运行,必须存在 Exchange Online 服务主体。To develop the native application, and later for the native application to run in a customer’s tenant, the Exchange Online service principal must be present. 在此情况下,开发人员和客户必须购买 Exchange Online,才能在其租户中创建服务主体。In this case, the developer and customer must purchase Exchange Online for the service principal to be created in their tenants.

如果它是由 Microsoft 以外的组织生成的 API,则 API 的开发人员需要提供一个可供其客户许可将其应用程序添加到客户租户中的方式。If it's an API built by an organization other than Microsoft, the developer of the API needs to provide a way for their customers to consent the application into their customers' tenants. 对于第三方开发人员,建议的设计是使所生成的 API 能够同时用作 Web 客户端来实现注册。The recommended design is for the third-party developer to build the API such that it can also function as a web client to implement sign-up. 为此,请按以下步骤操作:To do this:

  1. 根据前面各节的内容确保 API 实现多租户应用程序注册/代码要求。Follow the earlier sections to ensure the API implements the multi-tenant application registration/code requirements.
  2. 除了公开 API 的范围/角色之外,还需确保注册包括“登录和读取用户配置文件”权限(默认情况下会提供)。In addition to exposing the API's scopes/roles, make sure the registration includes the "Sign in and read user profile" permission (provided by default).
  3. 在 Web 客户端中实现登录/注册页面,并按照管理员同意指南操作。Implement a sign-in/sign-up page in the web client and follow the admin consent guidance.
  4. 当用户同意应用程序后,会在其租户中创建服务主体和同意委派链接,并且本机应用程序可以获取 API 的令牌。Once the user consents to the application, the service principal and consent delegation links are created in their tenant, and the native application can get tokens for the API.

下图针对在不同租户中注册的多层应用提供了同意概览。The following diagram provides an overview of consent for a multi-tier app registered in different tenants.

同意多层多方应用

用户和管理员可以随时吊销对应用程序的同意:Users and administrators can revoke consent to your application at any time:

如果是由管理员代表租户中的所有用户对应用程序行使同意权,用户就不能单独吊销访问权限。If an administrator consents to an application for all users in a tenant, users cannot revoke access individually. 只有管理员才能吊销访问权限,并且只能针对整个应用程序吊销。Only the administrator can revoke access, and only for the whole application.

多租户应用程序和缓存访问令牌Multi-tenant applications and caching access tokens

多租户应用程序也可以获取访问令牌来调用受 Azure AD 保护的 API。Multi-tenant applications can also get access tokens to call APIs that are protected by Azure AD. 配合多租户应用程序使用 Active Directory 身份验证库 (ADAL) 时经常会出现一个错误,就是一开始即使用 /common 来为用户请求令牌、接收响应,然后同样使用 /common 来为同一用户请求后续令牌。A common error when using the Active Directory Authentication Library (ADAL) with a multi-tenant application is to initially request a token for a user using /common, receive a response, then request a subsequent token for that same user also using /common. 由于从 Azure AD 返回的响应来自租户而不是 /common,因此 ADAL 缓存令牌时将它视为来自租户。Because the response from Azure AD comes from a tenant, not /common, ADAL caches the token as being from the tenant. 后续为了为用户获取访问令牌而执行的 /common 调用会错过缓存项,因此系统会再次提示用户登录。The subsequent call to /common to get an access token for the user misses the cache entry, and the user is prompted to sign in again. 为了避免缓存未命中,请确保后续为登录用户执行的调用是针对租户的终结点发出的。To avoid missing the cache, make sure subsequent calls for an already signed in user are made to the tenant’s endpoint.

后续步骤Next steps

本文介绍了如何构建可使用户从任何 Azure AD 租户进行登录的应用程序。In this article, you learned how to build an application that can sign in a user from any Azure AD tenant. 从而可以在应用程序中提供个性化体验,例如向用户显示上下文信息(例如个人资料图片或下一个日历约会)。This lets you offer a personalized experience in your application, such as showing contextual information to the users, like their profile picture or their next calendar appointment. 若要详细了解如何对 Azure AD 和 Office 365 服务(如 Exchange、SharePoint、OneDrive、OneNote 等)进行 API 调用,请访问:Microsoft Graph APITo learn more about making API calls to Azure AD and Office 365 services like Exchange, SharePoint, OneDrive, OneNote, and more, visit Microsoft Graph API.