Skip to content

Commit c4b8219

Browse files
committed
Use custom domain for JWT token issuer and audience instead of hardcoded value
1 parent a441c9d commit c4b8219

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

cloud-infrastructure/cluster/main-cluster.bicep

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ module keyVault '../modules/key-vault.bicep' = {
104104
subnetId: virtualNetwork.outputs.containerAppsSubnetId
105105
storageAccountId: diagnosticStorageAccount.outputs.storageAccountId
106106
workspaceId: existingLogAnalyticsWorkspace.id
107+
domainName: domainName
107108
}
108109
}
109110

cloud-infrastructure/modules/key-vault.bicep

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ param tenantId string
55
param subnetId string
66
param storageAccountId string
77
param workspaceId string
8+
param domainName string = ''
89

910
resource keyVault 'Microsoft.KeyVault/vaults@2023-07-01' = {
1011
name: name
@@ -119,19 +120,21 @@ resource authenticationTokenSigningKey 'Microsoft.KeyVault/vaults/keys@2023-07-0
119120
}
120121
}
121122

123+
var tokenIssuerAndAudience = domainName != '' ? 'https://${domainName}' : 'PlatformPlatform'
124+
122125
resource authenticationTokenIssuer 'Microsoft.KeyVault/vaults/secrets@2023-07-01' = {
123126
parent: keyVault
124127
name: 'authentication-token-issuer'
125128
properties: {
126-
value: 'PlatformPlatform' // Consider using the domain name (https://app.your-company.net) or company name (Your Company) as the issuer
129+
value: tokenIssuerAndAudience
127130
}
128131
}
129132

130133
resource authenticationTokenAudience 'Microsoft.KeyVault/vaults/secrets@2023-07-01' = {
131134
parent: keyVault
132135
name: 'authentication-token-audience'
133136
properties: {
134-
value: 'PlatformPlatform' // Consider using the domain name (https://product.your-company.net) or product name (product-name) as the audience
137+
value: tokenIssuerAndAudience
135138
}
136139
}
137140

0 commit comments

Comments
 (0)