Skip to content

Commit 3cd64f9

Browse files
committed
fix: allow clientSecretCertificateKeyVaultReference in AAD auth schema (#944)
The staticwebapp.config.json schema for azureActiveDirectory.registration required clientSecretSettingName and did not allow clientSecretCertificateKeyVaultReference, causing 'swa deploy' to reject the documented cert-based auth shape (see Microsoft Learn: Custom authentication in Azure Static Web Apps). Changes: - Add clientSecretCertificateKeyVaultReference property. - Remove clientSecretSettingName from unconditional 'required'. - Add oneOf requiring exactly one of the two credentials, so validation still enforces that a credential is configured. Guidance from @Timothyw0 on the issue pointed to this exact schema location.
1 parent 3ecb7b4 commit 3cd64f9

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

schema/staticwebapp.config.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
},
8282
"registration": {
8383
"type": "object",
84-
"required": ["openIdIssuer", "clientSecretSettingName"],
84+
"required": ["openIdIssuer"],
8585
"properties": {
8686
"openIdIssuer": {
8787
"type": "string",
@@ -93,9 +93,17 @@
9393
},
9494
"clientSecretSettingName": {
9595
"type": "string",
96-
"description": "The name of the application setting containing the client secret for the Azure AD app registration"
96+
"description": "The name of the application setting containing the client secret for the Azure AD app registration. Mutually exclusive with clientSecretCertificateKeyVaultReference."
97+
},
98+
"clientSecretCertificateKeyVaultReference": {
99+
"type": "string",
100+
"description": "A Key Vault reference to a certificate used as the client credential for the Azure AD app registration. Use this instead of clientSecretSettingName when authenticating with a certificate stored in Key Vault. See https://aka.ms/swa-authentication-custom"
97101
}
98102
},
103+
"oneOf": [
104+
{ "required": ["clientSecretSettingName"] },
105+
{ "required": ["clientSecretCertificateKeyVaultReference"] }
106+
],
99107
"additionalProperties": false
100108
},
101109
"login": {

0 commit comments

Comments
 (0)