如何:配置应用的服务条款和隐私声明How to: Configure terms of service and privacy statement for an app

构建和管理与 Azure Active Directory (Azure AD) 集成的应用的开发人员应随附指向应用的服务条款和隐私声明的链接。Developers who build and manage apps that integrate with Azure Active Directory (Azure AD) should include links to the app's terms of service and privacy statement. 服务条款和隐私声明通过用户同意体验展示给用户。The terms of service and privacy statement are surfaced to users through the user consent experience. 它们可以帮助用户认识到他们可以信任你的应用。They help your users know that they can trust your app. 对于面向用户的多租户应用(由多个目录使用的应用)来说,服务条款和隐私声明尤其至关重要。The terms of service and privacy statement are especially critical for user-facing multi-tenant apps--apps that are used by multiple directories.

你负责为你的应用创建服务条款和隐私声明文档,并提供指向这些文档的 URL。You are responsible for creating the terms of service and privacy statement documents for your app, and for providing the URLs to these documents. 对于未能提供这些链接的多租户应用,你的应用的用户同意体验将显示一条警报,可能阻碍用户同意使用你的应用。For multi-tenant apps that fail to provide these links, the user consent experience for your app will show an alert, which may discourage users from consenting to your app.

Note

  • 单租户应用不会显示警报。Single-tenant apps will not show an alert.
  • 如果缺少一个或两个两个链接,应用将显示警报。If one or both of the two links are missing, your app will show an alert.

下面的示例分别展示配置了服务条款和隐私声明以及未配置服务条款和隐私声明情况下的用户同意体验。The following examples show the user consent experience when the terms of service and privacy statement are configured and when these links are not configured.

提供了含有和不含隐私声明和服务条款的屏幕截图

添加指向应用的服务条款和隐私声明的文档之前,请确保 URL 遵循以下准则。Before you add links to your app's terms of service and privacy statement documents, make sure the URLs follow these guidelines.

准则Guideline 说明Description
格式Format 有效的 URLValid URL
有效的架构Valid schemas HTTP 和 HTTPSHTTP and HTTPS
建议使用 HTTPSWe recommend HTTPS
最大长度Max length 2048 个字符2048 characters

示例:https://myapp.com/terms-of-servicehttps://myapp.com/privacy-statementExamples: https://myapp.com/terms-of-service and https://myapp.com/privacy-statement

服务条款和隐私声明准备就绪后,可以在应用中使用这些方法之一添加指向这些文档的链接:When the terms of service and privacy statement are ready, you can add links to these documents in your app using one of these methods:

使用 Azure 门户Using the Azure portal

在 Azure 门户中执行以下步骤。Follow these steps in the Azure portal.

  1. 登录到 Azure 门户Sign in to the Azure portal.

  2. 导航到“应用注册”部分并选择应用 。Navigate to the App Registrations section and select your app.

  3. 打开“品牌” 窗格。Open the Branding pane.

  4. 填写“服务条款 URL”和“隐私声明 URL”字段 。Fill out the Terms of Service URL and Privacy Statement URL fields.

  5. 保存所做更改。Save your changes.

    含有服务条款和隐私声明 URL 的应用属性部分

使用应用对象 JSONUsing the app object JSON

如果想要直接修改应用对象 JSON,可以使用 Azure 门户中的清单编辑器来包含指向应用的服务条款和隐私声明的链接。If you prefer to modify the app object JSON directly, you can use the manifest editor in the Azure portal to include links to your app's terms of service and privacy statement.

    "informationalUrls": { 
        "termsOfService": "<your_terms_of_service_url>", 
        "privacy": "<your_privacy_statement_url>" 
    }

使用 MSGraph beta REST APIUsing the MSGraph beta REST API

若要以编程方式更新所有应用,可以使用 MSGraph beta REST API 更新所有应用,以包含指向服务条款和隐私声明文档的链接。To programmatically update all your apps, you can use the MSGraph beta REST API to update all your apps to include links to the terms of service and privacy statement documents.

PATCH https://microsoftgraph.chinacloudapi.cn/beta/applications/{application id}
{ 
    "appId": "{your application id}", 
    "info": { 
        "termsOfServiceUrl": "<your_terms_of_service_url>", 
        "supportUrl": null, 
        "privacyStatementUrl": "<your_privacy_statement_url>", 
        "marketingUrl": null, 
        "logoUrl": null 
    }
}

Note

  • 请注意不要覆盖已分配给以下任何字段的任何预先存在的值:supportUrl``marketingUrllogoUrlBe careful not to overwrite any pre-existing values you have assigned to any of these fields: supportUrl, marketingUrl, and logoUrl
  • 仅当使用 Azure AD 帐户登录时,MSGraph beta REST API 才会正常工作。The MSGraph beta REST API will only work when you sign in with an Azure AD account.