Web Apps - Get Auth Settings
取得應用程式的驗證/授權設定的描述。
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings/list?api-version=2024-04-01
URI 參數
名稱 | 位於 | 必要 | 類型 | Description |
---|---|---|---|---|
name
|
path | True |
string |
應用程式的名稱。 |
resource
|
path | True |
string minLength: 1maxLength: 90 pattern: ^[-\w\._\(\)]+[^\.]$ |
資源所屬的資源群組名稱。 |
subscription
|
path | True |
string |
您的 Azure 訂用帳戶標識碼。 這是 GUID 格式的字串(例如 0000000000-0000-0000-0000-0000000000000000)。 |
api-version
|
query | True |
string |
API 版本 |
回應
名稱 | 類型 | Description |
---|---|---|
200 OK |
還行 |
|
Other Status Codes |
App Service 錯誤回應。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow
類型:
oauth2
Flow:
implicit
授權 URL:
https://login.microsoftonline.com/common/oauth2/authorize
範圍
名稱 | Description |
---|---|
user_impersonation | 模擬您的用戶帳戶 |
範例
List Auth Settings
範例要求
範例回覆
{
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/sites/sitef6141/config/authsettings",
"name": "authsettings",
"type": "Microsoft.Web/sites/authsettings",
"kind": "app",
"properties": {
"enabled": true,
"runtimeVersion": "~1",
"unauthenticatedClientAction": "RedirectToLoginPage",
"tokenStoreEnabled": true,
"allowedExternalRedirectUrls": [
"sitef6141.customdomain.net",
"sitef6141.customdomain.info"
],
"defaultProvider": "Google",
"tokenRefreshExtensionHours": 120,
"clientId": "42d795a9-8abb-4d06-8534-39528af40f8e.apps.googleusercontent.com"
}
}
定義
名稱 | Description |
---|---|
Built |
設定多個提供者時要使用的預設驗證提供者。 只有在設定多個提供者,且未驗證的客戶端動作設定為 “RedirectToLoginPage” 時,才需要此設定。 |
Default |
App Service 錯誤回應。 |
Details | |
Error |
錯誤模型。 |
Site |
Azure App Service 驗證/授權功能的組態設定。 |
Unauthenticated |
當未經驗證的客戶端嘗試存取應用程式時要採取的動作。 |
BuiltInAuthenticationProvider
設定多個提供者時要使用的預設驗證提供者。 只有在設定多個提供者,且未驗證的客戶端動作設定為 “RedirectToLoginPage” 時,才需要此設定。
值 | Description |
---|---|
AzureActiveDirectory | |
Github | |
MicrosoftAccount | |
DefaultErrorResponse
App Service 錯誤回應。
名稱 | 類型 | Description |
---|---|---|
error |
錯誤模型。 |
Details
名稱 | 類型 | Description |
---|---|---|
code |
string |
以程式設計方式識別錯誤的標準化字串。 |
message |
string |
詳細的錯誤描述和偵錯資訊。 |
target |
string |
詳細的錯誤描述和偵錯資訊。 |
Error
錯誤模型。
名稱 | 類型 | Description |
---|---|---|
code |
string |
以程式設計方式識別錯誤的標準化字串。 |
details |
Details[] |
詳細的錯誤。 |
innererror |
string |
偵錯錯誤的詳細資訊。 |
message |
string |
詳細的錯誤描述和偵錯資訊。 |
target |
string |
詳細的錯誤描述和偵錯資訊。 |
SiteAuthSettings
Azure App Service 驗證/授權功能的組態設定。
名稱 | 類型 | Description |
---|---|---|
id |
string |
資源標識碼。 |
kind |
string |
資源種類。 |
name |
string |
資源名稱。 |
properties.aadClaimsAuthorization |
string |
取得包含 Azure AD Acl 設定的 JSON 字串。 |
properties.additionalLoginParams |
string[] |
當使用者登入時,要傳送至 OpenID Connect 授權端點的登入參數。 每個參數的格式都必須是 「key=value」。。 |
properties.allowedAudiences |
string[] |
允許的物件值在驗證 Azure Active Directory 所發出的 JSON Web 令牌時需要考慮。 請注意,不論此設定為何, |
properties.allowedExternalRedirectUrls |
string[] |
可在登入或註銷應用程式時重新導向至 的外部URL。 請注意,會忽略 URL 的查詢字串部分。 這是 Windows 市集應用程式後端通常需要的進階設定。 請注意,目前網域內的URL一律是隱含允許的。 |
properties.authFilePath |
string |
包含驗證設定的組態檔路徑。 如果路徑是相對的,基底會是月臺的根目錄。 |
properties.clientId |
string |
此信賴憑證者應用程式的用戶端標識碼,稱為client_id。 若要使用 Azure Active Directory 或其他第三方 OpenID Connect 提供者啟用 OpenID 連線驗證,則需要此設定。 OpenID Connect 的詳細資訊:http://openid.net/specs/openid-connect-core-1_0.html |
properties.clientSecret |
string |
此信賴憑證者應用程式的客戶端密碼(在 Azure Active Directory 中,也稱為密鑰)。 此設定是選擇性的。 如果未設定任何客戶端密碼,則會使用 OpenID Connect 隱含驗證流程來驗證終端使用者。 否則,OpenID Connect 授權碼流程會用來驗證使用者。 OpenID Connect 的詳細資訊:http://openid.net/specs/openid-connect-core-1_0.html |
properties.clientSecretCertificateThumbprint |
string |
客戶端密碼的替代方案,也就是用於簽署之憑證的指紋。 這個屬性可作為客戶端密碼的取代專案。 它也是選擇性的。 |
properties.clientSecretSettingName |
string |
包含信賴憑證者應用程式用戶端密碼的應用程式設定名稱。 |
properties.configVersion |
string |
用於目前應用程式的驗證/授權功能的 ConfigVersion。 此值中的設定可以控制驗證/授權的控制平面行為。 |
properties.defaultProvider |
設定多個提供者時要使用的預設驗證提供者。 只有在設定多個提供者,且未驗證的客戶端動作設定為 “RedirectToLoginPage” 時,才需要此設定。 |
|
properties.enabled |
boolean |
如果目前應用程式已啟用驗證/授權功能, |
properties.facebookAppId |
string |
用於登入的 Facebook 應用程式的應用程式識別碼。 啟用Facebook登入需要此設定。 Facebook 登入檔:https://developers.facebook.com/docs/facebook-login |
properties.facebookAppSecret |
string |
用於 Facebook 登入之 Facebook 應用程式的應用程式秘密。 啟用Facebook登入需要此設定。 Facebook 登入檔:https://developers.facebook.com/docs/facebook-login |
properties.facebookAppSecretSettingName |
string |
應用程式設定名稱,其中包含用於 Facebook 登入的應用程式密碼。 |
properties.facebookOAuthScopes |
string[] |
將作為Facebook登入驗證一部分要求的OAuth 2.0範圍。 此設定是選擇性的。 Facebook 登入檔:https://developers.facebook.com/docs/facebook-login |
properties.gitHubClientId |
string |
用於登入的 GitHub 應用程式的用戶端識別碼。 啟用 Github 登入需要此設定 |
properties.gitHubClientSecret |
string |
GitHub 應用程式用於 Github 登入的客戶端密碼。 啟用 Github 登入需要此設定。 |
properties.gitHubClientSecretSettingName |
string |
應用程式設定名稱,其中包含用於 GitHub 登入之 Github 應用程式的客戶端密碼。 |
properties.gitHubOAuthScopes |
string[] |
將作為 GitHub 登入驗證一部分要求的 OAuth 2.0 範圍。 此設定是選擇性的 |
properties.googleClientId |
string |
Google Web 應用程式的 OpenID Connect 用戶端識別碼。 啟用Google登入需要此設定。 Google Sign-In 檔:https://developers.google.com/identity/sign-in/web/ |
properties.googleClientSecret |
string |
與Google Web 應用程式相關聯的客戶端密碼。 啟用Google登入需要此設定。 Google Sign-In 檔:https://developers.google.com/identity/sign-in/web/ |
properties.googleClientSecretSettingName |
string |
應用程式設定名稱,其中包含與 Google Web 應用程式相關聯的客戶端密碼。 |
properties.googleOAuthScopes |
string[] |
將作為Google Sign-In 驗證一部分要求的OAuth 2.0範圍。 此設定是選擇性的。 如果未指定,則會使用 「openid」、“profile」 和 「email」 作為預設範圍。 Google Sign-In 檔:https://developers.google.com/identity/sign-in/web/ |
properties.isAuthFromFile |
string |
如果應該從檔案讀取驗證組態設定,則為 “true”,否則為 “false” |
properties.issuer |
string |
OpenID Connect 簽發者 URI,代表發出此應用程式存取令牌的實體。
使用 Azure Active Directory 時,此值是目錄租使用者的 URI,例如 |
properties.microsoftAccountClientId |
string |
針對用於驗證的應用程式所建立的 OAuth 2.0 用戶端識別碼。 啟用Microsoft帳戶驗證需要此設定。 Microsoft帳戶 OAuth 檔:https://dev.onedrive.com/auth/msa_oauth.htm |
properties.microsoftAccountClientSecret |
string |
針對用於驗證的應用程式所建立的 OAuth 2.0 客戶端密碼。 啟用Microsoft帳戶驗證需要此設定。 Microsoft帳戶 OAuth 檔:https://dev.onedrive.com/auth/msa_oauth.htm |
properties.microsoftAccountClientSecretSettingName |
string |
應用程式設定名稱,其中包含針對用於驗證的應用程式所建立的 OAuth 2.0 用戶端密碼。 |
properties.microsoftAccountOAuthScopes |
string[] |
將在帳戶驗證Microsoft一部分要求的 OAuth 2.0 範圍。 此設定是選擇性的。 如果未指定,則會使用 「wl.basic」 作為預設範圍。 Microsoft帳戶範圍和許可權檔:https://msdn.microsoft.com/en-us/library/dn631845.aspx |
properties.runtimeVersion |
string |
用於目前應用程式的驗證/授權功能的 RuntimeVersion。 此值中的設定可以控制驗證/授權模組中特定功能的行為。 |
properties.tokenRefreshExtensionHours |
number (double) |
會話令牌到期后的時數,會話令牌可用來呼叫令牌重新整理 API。 預設值為72小時。 |
properties.tokenStoreEnabled |
boolean |
|
properties.twitterConsumerKey |
string |
用於登入之 Twitter 應用程式的 OAuth 1.0a 取用者密鑰。 啟用 Twitter 登入需要此設定。 Twitter Sign-In 檔:https://dev.twitter.com/web/sign-in |
properties.twitterConsumerSecret |
string |
用於登入之 Twitter 應用程式的 OAuth 1.0a 取用者秘密。 啟用 Twitter 登入需要此設定。 Twitter Sign-In 檔:https://dev.twitter.com/web/sign-in |
properties.twitterConsumerSecretSettingName |
string |
應用程式設定名稱,其中包含用於登入之 Twitter 應用程式的 OAuth 1.0a 取用者密碼。 |
properties.unauthenticatedClientAction |
當未經驗證的客戶端嘗試存取應用程式時要採取的動作。 |
|
properties.validateIssuer |
boolean |
取得值,指出簽發者是否應為有效的 HTTPS URL,並加以驗證。 |
type |
string |
資源類型。 |
UnauthenticatedClientAction
當未經驗證的客戶端嘗試存取應用程式時要採取的動作。
值 | Description |
---|---|
AllowAnonymous | |
RedirectToLoginPage |