你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Microsoft.Web sites/slots/config 'authsettingsV2' 2021-03-01

Bicep 资源定义

可以使用面向以下操作部署 sites/slots/config 资源类型:

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

名称属性的选项

sites/slots/config 资源根据 name 属性的值接受不同的属性。 本文介绍设置 name: 'authsettingsV2'时可用的属性。

有关其他选项,请参阅:

资源格式

若要创建 Microsoft.Web/sites/slots/config 资源,请将以下 Bicep 添加到模板。

resource symbolicname 'Microsoft.Web/sites/slots/config@2021-03-01' = {
  name: 'authsettingsV2'
  kind: 'string'
  parent: resourceSymbolicName
  properties: {
    globalValidation: {
      excludedPaths: [
        'string'
      ]
      redirectToProvider: 'string'
      requireAuthentication: bool
      unauthenticatedClientAction: 'string'
    }
    httpSettings: {
      forwardProxy: {
        convention: 'string'
        customHostHeaderName: 'string'
        customProtoHeaderName: 'string'
      }
      requireHttps: bool
      routes: {
        apiPrefix: 'string'
      }
    }
    identityProviders: {
      apple: {
        enabled: bool
        login: {
          scopes: [
            'string'
          ]
        }
        registration: {
          clientId: 'string'
          clientSecretSettingName: 'string'
        }
      }
      azureActiveDirectory: {
        enabled: bool
        isAutoProvisioned: bool
        login: {
          disableWWWAuthenticate: bool
          loginParameters: [
            'string'
          ]
        }
        registration: {
          clientId: 'string'
          clientSecretCertificateIssuer: 'string'
          clientSecretCertificateSubjectAlternativeName: 'string'
          clientSecretCertificateThumbprint: 'string'
          clientSecretSettingName: 'string'
          openIdIssuer: 'string'
        }
        validation: {
          allowedAudiences: [
            'string'
          ]
          defaultAuthorizationPolicy: {
            allowedApplications: [
              'string'
            ]
            allowedPrincipals: {
              groups: [
                'string'
              ]
              identities: [
                'string'
              ]
            }
          }
          jwtClaimChecks: {
            allowedClientApplications: [
              'string'
            ]
            allowedGroups: [
              'string'
            ]
          }
        }
      }
      azureStaticWebApps: {
        enabled: bool
        registration: {
          clientId: 'string'
        }
      }
      customOpenIdConnectProviders: {}
      facebook: {
        enabled: bool
        graphApiVersion: 'string'
        login: {
          scopes: [
            'string'
          ]
        }
        registration: {
          appId: 'string'
          appSecretSettingName: 'string'
        }
      }
      gitHub: {
        enabled: bool
        login: {
          scopes: [
            'string'
          ]
        }
        registration: {
          clientId: 'string'
          clientSecretSettingName: 'string'
        }
      }
      google: {
        enabled: bool
        login: {
          scopes: [
            'string'
          ]
        }
        registration: {
          clientId: 'string'
          clientSecretSettingName: 'string'
        }
        validation: {
          allowedAudiences: [
            'string'
          ]
        }
      }
      legacyMicrosoftAccount: {
        enabled: bool
        login: {
          scopes: [
            'string'
          ]
        }
        registration: {
          clientId: 'string'
          clientSecretSettingName: 'string'
        }
        validation: {
          allowedAudiences: [
            'string'
          ]
        }
      }
      twitter: {
        enabled: bool
        registration: {
          consumerKey: 'string'
          consumerSecretSettingName: 'string'
        }
      }
    }
    login: {
      allowedExternalRedirectUrls: [
        'string'
      ]
      cookieExpiration: {
        convention: 'string'
        timeToExpiration: 'string'
      }
      nonce: {
        nonceExpirationInterval: 'string'
        validateNonce: bool
      }
      preserveUrlFragmentsForLogins: bool
      routes: {
        logoutEndpoint: 'string'
      }
      tokenStore: {
        azureBlobStorage: {
          sasUrlSettingName: 'string'
        }
        enabled: bool
        fileSystem: {
          directory: 'string'
        }
        tokenRefreshExtensionHours: int
      }
    }
    platform: {
      configFilePath: 'string'
      enabled: bool
      runtimeVersion: 'string'
    }
  }
}

属性值

sites/slots/config-authsettingsV2

名称 说明
name 资源名称

了解如何在 Bicep 中设置子资源的名称和类型。
“authsettingsV2”
kind 资源类型。 字符串
父级 (parent) 在 Bicep 中,可以为子资源指定父资源。 仅当子资源在父资源外部声明时,才需要添加此属性。

有关详细信息,请参阅 父资源之外的子资源
类型为:的资源的符号名称
properties SiteAuthSettingsV2 资源特定的属性 SiteAuthSettingsV2Properties

SiteAuthSettingsV2Properties

名称 说明
globalValidation 使用 App 服务 身份验证/授权确定用户的验证流的配置设置。 GlobalValidation
httpSettings 针对 App 服务 身份验证/授权发出的身份验证和授权请求的 HTTP 请求的配置设置。 HttpSettings
identityProviders 用于配置App 服务身份验证/授权的每个标识提供者的配置设置。 IdentityProviders
登录 使用 App 服务 身份验证/授权的用户登录流的配置设置。 登录
平台 App 服务身份验证/授权平台的配置设置。 AuthPlatform

GlobalValidation

名称 说明
excludedPaths 未经身份验证的流不会重定向到登录页的路径。 string[]
redirectToProvider 配置多个提供程序时使用的默认身份验证提供程序。
仅当配置了多个提供程序和未经身份验证的客户端时,才需要此设置
action 设置为“RedirectToLoginPage”。
字符串
requireAuthentication true 如果需要身份验证流,则发出任何请求;否则为 false bool
unauthenticatedClientAction 未经身份验证的客户端尝试访问应用时要执行的操作。 “AllowAnonymous”
“RedirectToLoginPage”
“Return401”
“Return403”

HttpSettings

名称 说明
forwardProxy 用于发出请求的转发代理的配置设置。 ForwardProxy
requireHttps false 如果允许没有 HTTPS 方案的身份验证/授权响应,则为 ;否则为 true bool
routes 路径 HTTP 请求的配置设置。 HttpSettingsRoutes

ForwardProxy

名称 说明
公约 用于确定所发出请求的 URL 的约定。 “Custom”
“NoProxy”
“Standard”
customHostHeaderName 包含请求主机的标头的名称。 字符串
customProtoHeaderName 包含请求方案的标头的名称。 字符串

HttpSettingsRoutes

名称 说明
apiPrefix 应在所有身份验证/授权路径之前的前缀。 字符串

IdentityProviders

名称 说明
apple Apple 提供程序的配置设置。 Apple
azureActiveDirectory Azure Active Directory 提供程序的配置设置。 AzureActiveDirectory
azureStaticWebApps Azure Static Web Apps提供程序的配置设置。 AzureStaticWebApps
customOpenIdConnectProviders 每个自定义 Open ID Connect 提供程序的别名的映射
自定义 Open ID Connect 提供程序的配置设置。
对象 (object)
facebook Facebook 提供程序的配置设置。 Facebook
gitHub GitHub 提供程序的配置设置。 GitHub
google Google 提供程序的配置设置。 Google
legacyMicrosoftAccount 旧版 Microsoft 帐户提供程序的配置设置。 LegacyMicrosoftAccount
twitter Twitter 提供程序的配置设置。 Twitter

Apple

名称 说明
enabled false 如果尽管设置了注册,但不应启用 Apple 提供程序;否则为 true bool
登录 登录流的配置设置。 LoginScopes
注册 Apple 注册的配置设置。 AppleRegistration

LoginScopes

名称 说明
范围 身份验证时应请求的范围的列表。 string[]

AppleRegistration

名称 说明
clientId 用于登录的应用的客户端 ID。 字符串
clientSecretSettingName 包含客户端密码的应用设置名称。 字符串

AzureActiveDirectory

名称 说明
enabled false 如果尽管设置了注册,但不应启用 Azure Active Directory 提供程序,则为 ;否则为 true bool
isAutoProvisioned 获取一个值,该值指示是否使用第一方工具自动预配 Azure AD 配置。
这是一个内部标志,主要用于支持 Azure 管理门户。 用户不应
读取或写入此属性。
bool
登录 Azure Active Directory 登录流的配置设置。 AzureActiveDirectoryLogin
注册 Azure Active Directory 应用注册的配置设置。 AzureActiveDirectoryRegistration
validation Azure Active Directory 令牌验证流的配置设置。 AzureActiveDirectoryValidation

AzureActiveDirectoryLogin

名称 说明
disableWWWAuthenticate true 如果请求中应省略 www-authenticate 提供程序,则为 ;否则为 false bool
loginParameters 在以下情况下要发送到 OpenID Connect 授权终结点的登录参数
用户登录。 每个参数必须采用“key=value”格式。
string[]

AzureActiveDirectoryRegistration

名称 说明
clientId 此信赖方应用程序的客户端 ID,称为client_id。
若要使用 Azure Active Directory 或 启用 OpenID 连接身份验证,需要此设置
其他第三方 OpenID Connect 提供程序。
有关 OpenID Connect 的详细信息: http://openid.net/specs/openid-connect-core-1_0.html
string
clientSecretCertificateIssuer 客户端机密指纹的替代方法,即用于签名的证书的颁发者。 此属性充当
客户端机密证书指纹的替代项。 这也是可选的。
string
clientSecretCertificateSubjectAlternativeName 客户端机密指纹的替代方法,即用于签名的证书的使用者可选名称。 此属性充当
客户端机密证书指纹的替代项。 这也是可选的。
字符串
clientSecretCertificateThumbprint 客户端密码的替代方法,即用于签名的证书的指纹。 此属性充当
客户端密码的替代项。 这也是可选的。
字符串
clientSecretSettingName 包含信赖方应用程序的客户端密码的应用设置名称。 字符串
openIdIssuer OpenID Connect 颁发者 URI,表示为此应用程序颁发访问令牌的实体。
使用 Azure Active Directory 时,此值是目录租户的 URI,例如 https://login.microsoftonline.com/v2.0/{tenant-guid}/.
此 URI 是令牌颁发者的区分大小写的标识符。
有关 OpenID Connect 发现的详细信息: http://openid.net/specs/openid-connect-discovery-1_0.html
字符串

AzureActiveDirectoryValidation

名称 说明
allowedAudiences 可以成功发出身份验证/授权请求的访问群体列表。 string[]
defaultAuthorizationPolicy 默认授权策略的配置设置。 DefaultAuthorizationPolicy
jwtClaimChecks 验证 JWT 声明时应进行的检查的配置设置。 JwtClaimChecks

DefaultAuthorizationPolicy

名称 说明
allowedApplications Azure Active Directory 允许的应用程序的配置设置。 string[]
allowedPrincipals Azure Active Directory 允许的主体的配置设置。 AllowedPrincipals

AllowedPrincipals

名称 说明
groups 允许的组的列表。 string[]
identities 允许的标识的列表。 string[]

JwtClaimChecks

名称 说明
allowedClientApplications 允许的客户端应用程序的列表。 string[]
allowedGroups 允许的组的列表。 string[]

AzureStaticWebApps

名称 说明
enabled false如果尽管设置了注册,但不应启用Azure Static Web Apps提供程序,则为 ;否则为 true bool
注册 Azure Static Web Apps注册的配置设置。 AzureStaticWebAppsRegistration

AzureStaticWebAppsRegistration

名称 说明
clientId 用于登录的应用的客户端 ID。 字符串

Facebook

名称 说明
enabled false 如果尽管设置了注册,但不应启用 Facebook 提供程序;否则为 true bool
graphApiVersion 登录时要使用的 Facebook API 版本。 字符串
登录 登录流的配置设置。 LoginScopes
注册 Facebook 提供程序的应用注册的配置设置。 AppRegistration

AppRegistration

名称 说明
appId 用于登录的应用的应用 ID。 字符串
appSecretSettingName 包含应用机密的应用设置名称。 字符串

GitHub

名称 说明
enabled false 如果尽管设置了注册,但不应启用 GitHub 提供程序,否则为 true bool
登录 登录流的配置设置。 LoginScopes
注册 GitHub 提供程序的应用注册的配置设置。 ClientRegistration

ClientRegistration

名称 说明
clientId 用于登录的应用的客户端 ID。 string
clientSecretSettingName 包含客户端密码的应用设置名称。 字符串

Google

名称 说明
enabled false 如果尽管设置了注册,但不应启用 Google 提供程序,则为 ;否则为 true bool
登录 登录流的配置设置。 LoginScopes
注册 Google 提供程序的应用注册的配置设置。 ClientRegistration
validation Azure Active Directory 令牌验证流的配置设置。 AllowedAudiencesValidation

AllowedAudiencesValidation

名称 说明
allowedAudiences 要从中验证 JWT 令牌的允许访问群体列表的配置设置。 string[]

LegacyMicrosoftAccount

名称 说明
enabled false 如果不应启用旧版 Microsoft 帐户提供程序(尽管已设置注册);否则为 true bool
登录 登录流的配置设置。 LoginScopes
注册 旧版 Microsoft 帐户提供程序的应用注册的配置设置。 ClientRegistration
validation 旧版 Microsoft 帐户提供程序令牌验证流的配置设置。 AllowedAudiencesValidation

Twitter

名称 说明
enabled false 如果尽管设置了注册,但不应启用 Twitter 提供程序,则为 ;否则为 true bool
注册 Twitter 提供程序的应用注册的配置设置。 TwitterRegistration

TwitterRegistration

名称 说明
consumerKey 用于登录的 Twitter 应用程序的 OAuth 1.0a 使用者密钥。
此设置是启用 Twitter 登录所必需的。
Twitter Sign-In 文档: https://dev.twitter.com/web/sign-in
string
consumerSecretSettingName 包含 Twitter 的 OAuth 1.0a 使用者机密的应用设置名称
用于登录的应用程序。
字符串

登录

名称 说明
allowedExternalRedirectUrls 登录或注销应用时可重定向到的外部 URL。 请注意,将忽略 URL 的查询字符串部分。
这是通常只有 Windows 应用商店应用程序后端才需要的高级设置。
请注意,始终隐式允许当前域中的 URL。
string[]
cookieExpiration 会话 Cookie 过期的配置设置。 CookieExpiration
nonce 登录流中使用的 nonce 的配置设置。 Nonce
preserveUrlFragmentsForLogins true 如果在发出登录请求后保留来自请求的片段,则为 ;否则为 false bool
routes 指定用于登录和注销请求的终结点的路由。 LoginRoutes
tokenStore 令牌存储的配置设置。 TokenStore

CookieExpiration

名称 说明
公约 确定会话 Cookie 的过期时使用的约定。 “FixedTime”
“IdentityProviderDerived”
timeToExpiration 发出请求后会话 Cookie 应过期的时间。 string

Nonce

名称 说明
nonceExpirationInterval 发出请求后,nonce 应过期的时间。 字符串
validateNonce false 如果在完成登录流时不应验证 nonce,则为 ;否则为 true bool

LoginRoutes

名称 说明
logoutEndpoint 应在其中发出注销请求的终结点。 字符串

TokenStore

名称 说明
azureBlobStorage 如果使用 Blob 存储,则为令牌存储的配置设置。 BlobStorageTokenStore
enabled true 以持久存储登录流期间获取的平台特定安全令牌;否则为 false
默认为 false
bool
fileSystem 如果使用文件系统,则为令牌存储的配置设置。 FileSystemTokenStore
tokenRefreshExtensionHours 会话令牌过期后可以使用会话令牌的小时数
调用令牌刷新 API。 默认值为 72 小时。
int

BlobStorageTokenStore

名称 说明
sasUrlSettingName 包含包含令牌的 Blob 存储的 SAS URL 的应用设置的名称。 字符串

FileSystemTokenStore

名称 说明 Value
目录 将存储令牌的目录。 字符串

AuthPlatform

名称 说明
configFilePath 包含身份验证设置的配置文件的路径(如果它们来自文件)。
如果路径是相对路径,则 base 将作为站点的根目录。
字符串
enabled true 如果为当前应用启用了身份验证/授权功能,则为 ;否则为 false bool
runtimeVersion 当前应用使用的身份验证/授权功能的 RuntimeVersion。
此值中的设置可以控制身份验证/授权模块中某些功能的行为。
字符串

ARM 模板资源定义

可以使用面向以下操作部署 sites/slots/config 资源类型:

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

名称属性的选项

sites/slots/config 资源根据 name 属性的值接受不同的属性。 本文介绍设置 name: 'authsettingsV2'时可用的属性。

有关其他选项,请参阅:

资源格式

若要创建 Microsoft.Web/sites/slots/config 资源,请将以下 JSON 添加到模板。

{
  "type": "Microsoft.Web/sites/slots/config",
  "apiVersion": "2021-03-01",
  "name": "authsettingsV2",
  "kind": "string",
  "properties": {
    "globalValidation": {
      "excludedPaths": [ "string" ],
      "redirectToProvider": "string",
      "requireAuthentication": "bool",
      "unauthenticatedClientAction": "string"
    },
    "httpSettings": {
      "forwardProxy": {
        "convention": "string",
        "customHostHeaderName": "string",
        "customProtoHeaderName": "string"
      },
      "requireHttps": "bool",
      "routes": {
        "apiPrefix": "string"
      }
    },
    "identityProviders": {
      "apple": {
        "enabled": "bool",
        "login": {
          "scopes": [ "string" ]
        },
        "registration": {
          "clientId": "string",
          "clientSecretSettingName": "string"
        }
      },
      "azureActiveDirectory": {
        "enabled": "bool",
        "isAutoProvisioned": "bool",
        "login": {
          "disableWWWAuthenticate": "bool",
          "loginParameters": [ "string" ]
        },
        "registration": {
          "clientId": "string",
          "clientSecretCertificateIssuer": "string",
          "clientSecretCertificateSubjectAlternativeName": "string",
          "clientSecretCertificateThumbprint": "string",
          "clientSecretSettingName": "string",
          "openIdIssuer": "string"
        },
        "validation": {
          "allowedAudiences": [ "string" ],
          "defaultAuthorizationPolicy": {
            "allowedApplications": [ "string" ],
            "allowedPrincipals": {
              "groups": [ "string" ],
              "identities": [ "string" ]
            }
          },
          "jwtClaimChecks": {
            "allowedClientApplications": [ "string" ],
            "allowedGroups": [ "string" ]
          }
        }
      },
      "azureStaticWebApps": {
        "enabled": "bool",
        "registration": {
          "clientId": "string"
        }
      },
      "customOpenIdConnectProviders": {},
      "facebook": {
        "enabled": "bool",
        "graphApiVersion": "string",
        "login": {
          "scopes": [ "string" ]
        },
        "registration": {
          "appId": "string",
          "appSecretSettingName": "string"
        }
      },
      "gitHub": {
        "enabled": "bool",
        "login": {
          "scopes": [ "string" ]
        },
        "registration": {
          "clientId": "string",
          "clientSecretSettingName": "string"
        }
      },
      "google": {
        "enabled": "bool",
        "login": {
          "scopes": [ "string" ]
        },
        "registration": {
          "clientId": "string",
          "clientSecretSettingName": "string"
        },
        "validation": {
          "allowedAudiences": [ "string" ]
        }
      },
      "legacyMicrosoftAccount": {
        "enabled": "bool",
        "login": {
          "scopes": [ "string" ]
        },
        "registration": {
          "clientId": "string",
          "clientSecretSettingName": "string"
        },
        "validation": {
          "allowedAudiences": [ "string" ]
        }
      },
      "twitter": {
        "enabled": "bool",
        "registration": {
          "consumerKey": "string",
          "consumerSecretSettingName": "string"
        }
      }
    },
    "login": {
      "allowedExternalRedirectUrls": [ "string" ],
      "cookieExpiration": {
        "convention": "string",
        "timeToExpiration": "string"
      },
      "nonce": {
        "nonceExpirationInterval": "string",
        "validateNonce": "bool"
      },
      "preserveUrlFragmentsForLogins": "bool",
      "routes": {
        "logoutEndpoint": "string"
      },
      "tokenStore": {
        "azureBlobStorage": {
          "sasUrlSettingName": "string"
        },
        "enabled": "bool",
        "fileSystem": {
          "directory": "string"
        },
        "tokenRefreshExtensionHours": "int"
      }
    },
    "platform": {
      "configFilePath": "string",
      "enabled": "bool",
      "runtimeVersion": "string"
    }
  }
}

属性值

sites/slots/config-authsettingsV2

名称 说明 Value
type 资源类型 'Microsoft.Web/sites/slots/config'
apiVersion 资源 API 版本 '2021-03-01'
name 资源名称

了解如何在 JSON ARM 模板中设置子资源的名称和类型。
“authsettingsV2”
kind 资源类型。 string
properties SiteAuthSettingsV2 资源特定的属性 SiteAuthSettingsV2Properties

SiteAuthSettingsV2Properties

名称 说明
globalValidation 使用 App 服务 身份验证/授权确定用户的验证流的配置设置。 GlobalValidation
httpSettings 针对 App 服务 身份验证/授权发出的身份验证和授权请求的 HTTP 请求的配置设置。 HttpSettings
identityProviders 用于配置App 服务身份验证/授权的每个标识提供者的配置设置。 IdentityProviders
登录 使用 App 服务 身份验证/授权的用户登录流的配置设置。 登录
平台 App 服务身份验证/授权平台的配置设置。 AuthPlatform

GlobalValidation

名称 说明 Value
excludedPaths 未经身份验证的流不会重定向到登录页的路径。 string[]
redirectToProvider 配置多个提供程序时使用的默认身份验证提供程序。
仅当配置了多个提供程序和未经身份验证的客户端时,才需要此设置
action 设置为“RedirectToLoginPage”。
字符串
requireAuthentication true 如果需要身份验证流,则发出任何请求;否则为 false bool
unauthenticatedClientAction 未经身份验证的客户端尝试访问应用时要执行的操作。 “AllowAnonymous”
“RedirectToLoginPage”
“Return401”
“Return403”

HttpSettings

名称 说明
forwardProxy 用于发出请求的转发代理的配置设置。 ForwardProxy
requireHttps false 如果允许没有 HTTPS 方案的身份验证/授权响应,则为 ;否则为 true bool
routes 路径 HTTP 请求的配置设置。 HttpSettingsRoutes

ForwardProxy

名称 说明
公约 用于确定所发出请求的 URL 的约定。 “Custom”
“NoProxy”
“Standard”
customHostHeaderName 包含请求主机的标头的名称。 string
customProtoHeaderName 包含请求方案的标头的名称。 字符串

HttpSettingsRoutes

名称 说明
apiPrefix 应在所有身份验证/授权路径之前的前缀。 字符串

IdentityProviders

名称 说明
apple Apple 提供程序的配置设置。 Apple
azureActiveDirectory Azure Active Directory 提供程序的配置设置。 AzureActiveDirectory
azureStaticWebApps Azure Static Web Apps提供程序的配置设置。 AzureStaticWebApps
customOpenIdConnectProviders 每个自定义 Open ID Connect 提供程序的别名的映射
自定义 Open ID Connect 提供程序的配置设置。
对象 (object)
facebook Facebook 提供程序的配置设置。 Facebook
gitHub GitHub 提供程序的配置设置。 GitHub
google Google 提供程序的配置设置。 Google
legacyMicrosoftAccount 旧版 Microsoft 帐户提供程序的配置设置。 LegacyMicrosoftAccount
twitter Twitter 提供程序的配置设置。 Twitter

Apple

名称 说明
enabled false 如果尽管设置了注册,但不应启用 Apple 提供程序;否则为 true bool
登录 登录流的配置设置。 LoginScopes
注册 Apple 注册的配置设置。 AppleRegistration

LoginScopes

名称 说明
范围 身份验证时应请求的范围的列表。 string[]

AppleRegistration

名称 说明
clientId 用于登录的应用的客户端 ID。 string
clientSecretSettingName 包含客户端密码的应用设置名称。 字符串

AzureActiveDirectory

名称 说明
enabled false 如果不应启用 Azure Active Directory 提供程序(尽管设置了注册);否则为 true bool
isAutoProvisioned 获取一个值,该值指示是否使用第一方工具自动预配 Azure AD 配置。
这是一个内部标志,主要用于支持 Azure 管理门户。 用户不应
读取或写入此属性。
bool
登录 Azure Active Directory 登录流的配置设置。 AzureActiveDirectoryLogin
注册 Azure Active Directory 应用注册的配置设置。 AzureActiveDirectoryRegistration
validation Azure Active Directory 令牌验证流的配置设置。 AzureActiveDirectoryValidation

AzureActiveDirectoryLogin

名称 说明
disableWWWAuthenticate true 如果请求中应省略 www-authenticate 提供程序,则为 ;否则为 false bool
loginParameters 在以下情况下要发送到 OpenID Connect 授权终结点的登录参数
用户登录。 每个参数必须采用“key=value”格式。
string[]

AzureActiveDirectoryRegistration

名称 说明
clientId 此信赖方应用程序的客户端 ID,称为client_id。
若要使用 Azure Active Directory 或 启用 OpenID 连接身份验证,需要此设置
其他第三方 OpenID Connect 提供程序。
有关 OpenID Connect 的详细信息: http://openid.net/specs/openid-connect-core-1_0.html
字符串
clientSecretCertificateIssuer 客户端机密指纹的替代方法,即用于签名的证书的颁发者。 此属性充当
客户端机密证书指纹的替代项。 这也是可选的。
字符串
clientSecretCertificateSubjectAlternativeName 客户端机密指纹的替代方法,即用于签名的证书的使用者可选名称。 此属性充当
客户端机密证书指纹的替代项。 这也是可选的。
字符串
clientSecretCertificateThumbprint 客户端密码的替代方法,即用于签名的证书的指纹。 此属性充当
客户端密码的替代项。 这也是可选的。
字符串
clientSecretSettingName 包含信赖方应用程序的客户端密码的应用设置名称。 字符串
openIdIssuer OpenID Connect 颁发者 URI,表示为此应用程序颁发访问令牌的实体。
使用 Azure Active Directory 时,此值是目录租户的 URI,例如 https://login.microsoftonline.com/v2.0/{tenant-guid}/.
此 URI 是令牌颁发者的区分大小写的标识符。
有关 OpenID Connect 发现的详细信息: http://openid.net/specs/openid-connect-discovery-1_0.html
字符串

AzureActiveDirectoryValidation

名称 说明
allowedAudiences 可以成功发出身份验证/授权请求的访问群体列表。 string[]
defaultAuthorizationPolicy 默认授权策略的配置设置。 DefaultAuthorizationPolicy
jwtClaimChecks 验证 JWT 声明时应进行的检查的配置设置。 JwtClaimChecks

DefaultAuthorizationPolicy

名称 说明
allowedApplications Azure Active Directory 允许的应用程序的配置设置。 string[]
allowedPrincipals Azure Active Directory 允许的主体的配置设置。 AllowedPrincipals

AllowedPrincipals

名称 说明
groups 允许的组的列表。 string[]
identities 允许的标识的列表。 string[]

JwtClaimChecks

名称 说明
allowedClientApplications 允许的客户端应用程序的列表。 string[]
allowedGroups 允许的组的列表。 string[]

AzureStaticWebApps

名称 说明
enabled false如果尽管设置了注册,但不应启用Azure Static Web Apps提供程序,则为 ;否则为 true bool
注册 Azure Static Web Apps注册的配置设置。 AzureStaticWebAppsRegistration

AzureStaticWebAppsRegistration

名称 说明
clientId 用于登录的应用的客户端 ID。 字符串

Facebook

名称 说明
enabled false 如果尽管设置了注册,但不应启用 Facebook 提供程序,则为 ;否则为 true bool
graphApiVersion 登录时要使用的 Facebook API 版本。 字符串
登录 登录流的配置设置。 LoginScopes
注册 Facebook 提供程序的应用注册的配置设置。 AppRegistration

AppRegistration

名称 说明
appId 用于登录的应用的应用 ID。 字符串
appSecretSettingName 包含应用机密的应用设置名称。 string

GitHub

名称 说明
enabled false 如果不应启用 GitHub 提供程序(尽管设置了注册);否则为 true bool
登录 登录流的配置设置。 LoginScopes
注册 GitHub 提供程序的应用注册的配置设置。 ClientRegistration

ClientRegistration

名称 说明
clientId 用于登录的应用的客户端 ID。 字符串
clientSecretSettingName 包含客户端密码的应用设置名称。 string

Google

名称 说明
enabled false 如果尽管设置了注册,但不应启用 Google 提供程序,则为 ;否则为 true bool
登录 登录流的配置设置。 LoginScopes
注册 Google 提供程序的应用注册的配置设置。 ClientRegistration
validation Azure Active Directory 令牌验证流的配置设置。 AllowedAudiencesValidation

AllowedAudiencesValidation

名称 说明
allowedAudiences 要从中验证 JWT 令牌的允许访问群体列表的配置设置。 string[]

LegacyMicrosoftAccount

名称 说明
enabled false 如果不应启用旧版 Microsoft 帐户提供程序(尽管已设置注册);否则为 true bool
登录 登录流的配置设置。 LoginScopes
注册 旧版 Microsoft 帐户提供程序的应用注册的配置设置。 ClientRegistration
validation 旧版 Microsoft 帐户提供程序令牌验证流的配置设置。 AllowedAudiencesValidation

Twitter

名称 说明
enabled false 如果尽管设置了注册,但不应启用 Twitter 提供程序;否则为 true bool
注册 Twitter 提供程序的应用注册的配置设置。 TwitterRegistration

TwitterRegistration

名称 说明
consumerKey 用于登录的 Twitter 应用程序的 OAuth 1.0a 使用者密钥。
启用 Twitter 登录需要此设置。
Twitter Sign-In 文档: https://dev.twitter.com/web/sign-in
字符串
consumerSecretSettingName 包含 Twitter 的 OAuth 1.0a 使用者机密的应用设置名称
用于登录的应用程序。
字符串

登录

名称 说明
allowedExternalRedirectUrls 可在登录或注销应用时重定向到的外部 URL。 请注意,将忽略 URL 的查询字符串部分。
这是一种高级设置,通常只有 Windows 应用商店应用程序后端才需要。
请注意,始终隐式允许当前域中的 URL。
string[]
cookieExpiration 会话 Cookie 过期的配置设置。 CookieExpiration
nonce 登录流中使用的 nonce 的配置设置。 Nonce
preserveUrlFragmentsForLogins true 如果在发出登录请求后保留请求中的片段,则为 ;否则为 false bool
routes 指定用于登录和注销请求的终结点的路由。 LoginRoutes
tokenStore 令牌存储的配置设置。 TokenStore

CookieExpiration

名称 说明
公约 确定会话 Cookie 过期时使用的约定。 “FixedTime”
“IdentityProviderDerived”
timeToExpiration 发出请求后会话 Cookie 应过期的时间。 string

Nonce

名称 说明
nonceExpirationInterval 发出请求后,nonce 应过期的时间。 字符串
validateNonce false 如果在完成登录流时不应验证 nonce,则为 ;否则为 true bool

LoginRoutes

名称 说明
logoutEndpoint 应在其中发出注销请求的终结点。 字符串

TokenStore

名称 说明
azureBlobStorage 如果使用 Blob 存储,则为令牌存储的配置设置。 BlobStorageTokenStore
enabled true 用于持久存储登录流期间获取的平台特定安全令牌;否则为 false
默认为 false
bool
fileSystem 使用文件系统时令牌存储的配置设置。 FileSystemTokenStore
tokenRefreshExtensionHours 会话令牌过期后可以使用会话令牌的小时数
调用令牌刷新 API。 默认值为 72 小时。
int

BlobStorageTokenStore

名称 说明
sasUrlSettingName 包含包含令牌的 Blob 存储的 SAS URL 的应用设置的名称。 字符串

FileSystemTokenStore

名称 说明 Value
目录 将存储令牌的目录。 string

AuthPlatform

名称 说明
configFilePath 包含身份验证设置的配置文件的路径(如果它们来自文件)。
如果路径是相对路径,则 base 将用于站点的根目录。
字符串
enabled true 如果为当前应用启用了身份验证/授权功能,则为 ;否则为 false bool
runtimeVersion 用于当前应用的身份验证/授权功能的 RuntimeVersion。
此值中的设置可以控制身份验证/授权模块中某些功能的行为。
string

Terraform (AzAPI 提供程序) 资源定义

可以使用针对以下操作部署 sites/slots/config 资源类型:

  • 资源组

有关每个 API 版本中更改的属性的列表,请参阅 更改日志

名称属性的选项

sites/slots/config 资源根据 name 属性的值接受不同的属性。 本文介绍设置 name: 'authsettingsV2'时可用的属性。

有关其他选项,请参阅:

资源格式

若要创建 Microsoft.Web/sites/slots/config 资源,请将以下 Terraform 添加到模板。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Web/sites/slots/config@2021-03-01"
  name = "authsettingsV2"
  parent_id = "string"
  body = jsonencode({
    properties = {
      globalValidation = {
        excludedPaths = [
          "string"
        ]
        redirectToProvider = "string"
        requireAuthentication = bool
        unauthenticatedClientAction = "string"
      }
      httpSettings = {
        forwardProxy = {
          convention = "string"
          customHostHeaderName = "string"
          customProtoHeaderName = "string"
        }
        requireHttps = bool
        routes = {
          apiPrefix = "string"
        }
      }
      identityProviders = {
        apple = {
          enabled = bool
          login = {
            scopes = [
              "string"
            ]
          }
          registration = {
            clientId = "string"
            clientSecretSettingName = "string"
          }
        }
        azureActiveDirectory = {
          enabled = bool
          isAutoProvisioned = bool
          login = {
            disableWWWAuthenticate = bool
            loginParameters = [
              "string"
            ]
          }
          registration = {
            clientId = "string"
            clientSecretCertificateIssuer = "string"
            clientSecretCertificateSubjectAlternativeName = "string"
            clientSecretCertificateThumbprint = "string"
            clientSecretSettingName = "string"
            openIdIssuer = "string"
          }
          validation = {
            allowedAudiences = [
              "string"
            ]
            defaultAuthorizationPolicy = {
              allowedApplications = [
                "string"
              ]
              allowedPrincipals = {
                groups = [
                  "string"
                ]
                identities = [
                  "string"
                ]
              }
            }
            jwtClaimChecks = {
              allowedClientApplications = [
                "string"
              ]
              allowedGroups = [
                "string"
              ]
            }
          }
        }
        azureStaticWebApps = {
          enabled = bool
          registration = {
            clientId = "string"
          }
        }
        customOpenIdConnectProviders = {}
        facebook = {
          enabled = bool
          graphApiVersion = "string"
          login = {
            scopes = [
              "string"
            ]
          }
          registration = {
            appId = "string"
            appSecretSettingName = "string"
          }
        }
        gitHub = {
          enabled = bool
          login = {
            scopes = [
              "string"
            ]
          }
          registration = {
            clientId = "string"
            clientSecretSettingName = "string"
          }
        }
        google = {
          enabled = bool
          login = {
            scopes = [
              "string"
            ]
          }
          registration = {
            clientId = "string"
            clientSecretSettingName = "string"
          }
          validation = {
            allowedAudiences = [
              "string"
            ]
          }
        }
        legacyMicrosoftAccount = {
          enabled = bool
          login = {
            scopes = [
              "string"
            ]
          }
          registration = {
            clientId = "string"
            clientSecretSettingName = "string"
          }
          validation = {
            allowedAudiences = [
              "string"
            ]
          }
        }
        twitter = {
          enabled = bool
          registration = {
            consumerKey = "string"
            consumerSecretSettingName = "string"
          }
        }
      }
      login = {
        allowedExternalRedirectUrls = [
          "string"
        ]
        cookieExpiration = {
          convention = "string"
          timeToExpiration = "string"
        }
        nonce = {
          nonceExpirationInterval = "string"
          validateNonce = bool
        }
        preserveUrlFragmentsForLogins = bool
        routes = {
          logoutEndpoint = "string"
        }
        tokenStore = {
          azureBlobStorage = {
            sasUrlSettingName = "string"
          }
          enabled = bool
          fileSystem = {
            directory = "string"
          }
          tokenRefreshExtensionHours = int
        }
      }
      platform = {
        configFilePath = "string"
        enabled = bool
        runtimeVersion = "string"
      }
    }
    kind = "string"
  })
}

属性值

sites/slots/config-authsettingsV2

名称 说明 Value
type 资源类型 “Microsoft.Web/sites/slots/config@2021-03-01”
name 资源名称 “authsettingsV2”
parent_id 此资源的父资源 ID。 类型为“”的资源的 ID
kind 资源类型。 string
properties SiteAuthSettingsV2 资源特定的属性 SiteAuthSettingsV2Properties

SiteAuthSettingsV2Properties

名称 说明
globalValidation 使用App 服务身份验证/授权确定用户的验证流的配置设置。 GlobalValidation
httpSettings 针对身份验证/授权的 HTTP 请求的配置设置和针对App 服务身份验证/授权发出的授权请求。 HttpSettings
identityProviders 用于配置身份验证/授权的每个标识提供者的配置设置App 服务。 IdentityProviders
登录 使用 App 服务 身份验证/授权的用户登录流的配置设置。 登录
平台 App 服务身份验证/授权平台的配置设置。 AuthPlatform

GlobalValidation

名称 说明 Value
excludedPaths 未经身份验证的流不会重定向到登录页的路径。 string[]
redirectToProvider 配置多个提供程序时要使用的默认身份验证提供程序。
仅当配置了多个提供程序和未经身份验证的客户端时,才需要此设置
action 设置为“RedirectToLoginPage”。
字符串
requireAuthentication true 如果需要身份验证流,则发出任何请求;否则为 false bool
unauthenticatedClientAction 未经身份验证的客户端尝试访问应用时要执行的操作。 “AllowAnonymous”
“RedirectToLoginPage”
“Return401”
“Return403”

HttpSettings

名称 说明
forwardProxy 用于发出请求的转发代理的配置设置。 ForwardProxy
requireHttps false 如果允许没有 HTTPS 方案的身份验证/授权响应,则为 ;否则为 true bool
routes 路径 HTTP 请求的配置设置。 HttpSettingsRoutes

ForwardProxy

名称 说明
公约 用于确定所发出请求的 URL 的约定。 “Custom”
“NoProxy”
“Standard”
customHostHeaderName 包含请求主机的标头的名称。 string
customProtoHeaderName 包含请求方案的标头的名称。 字符串

HttpSettingsRoutes

名称 说明
apiPrefix 应在所有身份验证/授权路径之前的前缀。 string

IdentityProviders

名称 说明
apple Apple 提供程序的配置设置。 Apple
azureActiveDirectory Azure Active Directory 提供程序的配置设置。 AzureActiveDirectory
azureStaticWebApps Azure Static Web Apps提供程序的配置设置。 AzureStaticWebApps
customOpenIdConnectProviders 每个自定义 Open ID Connect 提供程序的别名的映射
自定义 Open ID Connect 提供程序的配置设置。
对象 (object)
facebook Facebook 提供程序的配置设置。 Facebook
gitHub GitHub 提供程序的配置设置。 GitHub
google Google 提供程序的配置设置。 Google
legacyMicrosoftAccount 旧版 Microsoft 帐户提供程序的配置设置。 LegacyMicrosoftAccount
twitter Twitter 提供程序的配置设置。 Twitter

Apple

名称 说明
enabled false 如果尽管设置了注册,但不应启用 Apple 提供程序;否则为 true bool
登录 登录流的配置设置。 LoginScopes
注册 Apple 注册的配置设置。 AppleRegistration

LoginScopes

名称 说明
范围 身份验证时应请求的范围的列表。 string[]

AppleRegistration

名称 说明
clientId 用于登录的应用的客户端 ID。 字符串
clientSecretSettingName 包含客户端密码的应用设置名称。 字符串

AzureActiveDirectory

名称 说明
enabled false 如果尽管设置了注册,但不应启用 Azure Active Directory 提供程序,则为 ;否则为 true bool
isAutoProvisioned 获取一个值,该值指示是否使用第一方工具自动预配 Azure AD 配置。
这是一个内部标志,主要用于支持 Azure 管理门户。 用户不应
读取或写入此属性。
bool
登录 Azure Active Directory 登录流的配置设置。 AzureActiveDirectoryLogin
注册 Azure Active Directory 应用注册的配置设置。 AzureActiveDirectoryRegistration
validation Azure Active Directory 令牌验证流的配置设置。 AzureActiveDirectoryValidation

AzureActiveDirectoryLogin

名称 说明
disableWWWAuthenticate true 如果请求中应省略 www-authenticate 提供程序,则为 ;否则为 false bool
loginParameters 在以下情况下发送到 OpenID Connect 授权终结点的登录参数
用户登录。 每个参数必须采用“key=value”格式。
string[]

AzureActiveDirectoryRegistration

名称 说明
clientId 此信赖方应用程序的客户端 ID,称为 client_id。
若要使用 Azure Active Directory 或启用 OpenID 连接身份验证,需要此设置
其他第三方 OpenID Connect 提供程序。
有关 OpenID Connect 的详细信息: http://openid.net/specs/openid-connect-core-1_0.html
字符串
clientSecretCertificateIssuer 客户端机密指纹的替代方法,即用于签名的证书的颁发者。 此属性充当
客户端机密证书指纹的替换。 这也是可选的。
字符串
clientSecretCertificateSubjectAlternativeName 客户端机密指纹的替代项,即用于签名的证书的使用者可选名称。 此属性充当
客户端机密证书指纹的替换。 这也是可选的。
字符串
clientSecretCertificateThumbprint 客户端密码的替代方法,即用于签名的证书的指纹。 此属性充当
客户端密码的替换。 这也是可选的。
字符串
clientSecretSettingName 包含信赖方应用程序的客户端密码的应用设置名称。 字符串
openIdIssuer OpenID Connect 颁发者 URI,表示颁发此应用程序的访问令牌的实体。
使用 Azure Active Directory 时,此值是目录租户的 URI,例如 https://login.microsoftonline.com/v2.0/{tenant-guid}/.
此 URI 是令牌颁发者的区分大小写的标识符。
有关 OpenID Connect Discovery 的详细信息: http://openid.net/specs/openid-connect-discovery-1_0.html
字符串

AzureActiveDirectoryValidation

名称 说明
allowedAudiences 可以成功发出身份验证/授权请求的访问群体列表。 string[]
defaultAuthorizationPolicy 默认授权策略的配置设置。 DefaultAuthorizationPolicy
jwtClaimChecks 验证 JWT 声明时应进行的检查的配置设置。 JwtClaimChecks

DefaultAuthorizationPolicy

名称 说明 Value
allowedApplications Azure Active Directory 允许的应用程序的配置设置。 string[]
allowedPrincipals Azure Active Directory 允许的主体的配置设置。 AllowedPrincipals

AllowedPrincipals

名称 说明 Value
groups 允许的组的列表。 string[]
identities 允许的标识的列表。 string[]

JwtClaimChecks

名称 说明
allowedClientApplications 允许的客户端应用程序的列表。 string[]
allowedGroups 允许的组的列表。 string[]

AzureStaticWebApps

名称 说明
enabled false如果尽管设置了注册,但不应启用Azure Static Web Apps提供程序,则为 ;否则为 true bool
注册 Azure Static Web Apps注册的配置设置。 AzureStaticWebAppsRegistration

AzureStaticWebAppsRegistration

名称 说明
clientId 用于登录的应用的客户端 ID。 string

Facebook

名称 说明
enabled false 如果尽管设置了注册,但不应启用 Facebook 提供程序,则为 ;否则为 true bool
graphApiVersion 登录时要使用的 Facebook API 版本。 string
登录 登录流的配置设置。 LoginScopes
注册 Facebook 提供程序的应用注册的配置设置。 AppRegistration

AppRegistration

名称 说明
appId 用于登录的应用的应用 ID。 字符串
appSecretSettingName 包含应用机密的应用设置名称。 字符串

GitHub

名称 说明
enabled false 如果不应启用 GitHub 提供程序(尽管设置了注册);否则为 true bool
登录 登录流的配置设置。 LoginScopes
注册 GitHub 提供程序的应用注册的配置设置。 ClientRegistration

ClientRegistration

名称 说明
clientId 用于登录的应用的客户端 ID。 字符串
clientSecretSettingName 包含客户端密码的应用设置名称。 字符串

Google

名称 说明
enabled false 如果尽管设置了注册,但不应启用 Google 提供程序,则为 ;否则为 true bool
登录 登录流的配置设置。 LoginScopes
注册 Google 提供程序的应用注册的配置设置。 ClientRegistration
validation Azure Active Directory 令牌验证流的配置设置。 AllowedAudiencesValidation

AllowedAudiencesValidation

名称 说明
allowedAudiences 要从中验证 JWT 令牌的访问群体的允许列表的配置设置。 string[]

LegacyMicrosoftAccount

名称 说明
enabled false 如果尽管设置了注册,但不应启用旧版 Microsoft 帐户提供程序,则为 ;否则为 true bool
登录 登录流的配置设置。 LoginScopes
注册 旧版 Microsoft 帐户提供程序的应用注册的配置设置。 ClientRegistration
validation 旧版 Microsoft 帐户提供程序令牌验证流的配置设置。 AllowedAudiencesValidation

Twitter

名称 说明
enabled false 如果尽管设置了注册,但不应启用 Twitter 提供程序,则为 ;否则为 true bool
注册 Twitter 提供程序的应用注册的配置设置。 TwitterRegistration

TwitterRegistration

名称 说明
consumerKey 用于登录的 Twitter 应用程序的 OAuth 1.0a 使用者密钥。
此设置是启用 Twitter 登录所必需的。
Twitter Sign-In 文档: https://dev.twitter.com/web/sign-in
string
consumerSecretSettingName 包含 Twitter 的 OAuth 1.0a 使用者机密的应用设置名称
用于登录的应用程序。
字符串

登录

名称 说明
allowedExternalRedirectUrls 登录或注销应用时可重定向到的外部 URL。 请注意,将忽略 URL 的查询字符串部分。
这是通常只有 Windows 应用商店应用程序后端才需要的高级设置。
请注意,始终隐式允许当前域中的 URL。
string[]
cookieExpiration 会话 Cookie 过期的配置设置。 CookieExpiration
nonce 登录流中使用的 nonce 的配置设置。 Nonce
preserveUrlFragmentsForLogins true 如果在发出登录请求后保留来自请求的片段,则为 ;否则为 false bool
routes 指定用于登录和注销请求的终结点的路由。 LoginRoutes
tokenStore 令牌存储的配置设置。 TokenStore

CookieExpiration

名称 说明
公约 确定会话 Cookie 的过期时使用的约定。 “FixedTime”
“IdentityProviderDerived”
timeToExpiration 发出请求后会话 Cookie 应过期的时间。 字符串

Nonce

名称 说明
nonceExpirationInterval 发出请求后,nonce 应过期的时间。 string
validateNonce false 如果在完成登录流时不应验证 nonce,则为 ;否则为 true bool

LoginRoutes

名称 说明 Value
logoutEndpoint 应在其中发出注销请求的终结点。 string

TokenStore

名称 说明 Value
azureBlobStorage 如果使用 Blob 存储,则为令牌存储的配置设置。 BlobStorageTokenStore
enabled true 以持久存储登录流期间获取的平台特定安全令牌;否则为 false
默认为 false
bool
fileSystem 如果使用文件系统,则为令牌存储的配置设置。 FileSystemTokenStore
tokenRefreshExtensionHours 会话令牌过期后可以使用会话令牌的小时数
调用令牌刷新 API。 默认值为 72 小时。
int

BlobStorageTokenStore

名称 说明 Value
sasUrlSettingName 包含包含令牌的 Blob 存储的 SAS URL 的应用设置的名称。 字符串

FileSystemTokenStore

名称 说明 Value
目录 将存储令牌的目录。 string

AuthPlatform

名称 说明
configFilePath 包含身份验证设置的配置文件的路径(如果它们来自文件)。
如果路径是相对路径,则 base 将作为站点的根目录。
字符串
enabled true 如果为当前应用启用了身份验证/授权功能,则为 ;否则为 false bool
runtimeVersion 当前应用使用的身份验证/授权功能的 RuntimeVersion。
此值中的设置可以控制身份验证/授权模块中某些功能的行为。
字符串