Skip to content

Commit 567c049

Browse files
authored
Merge pull request KelvinTegelaar#1612 from KelvinTegelaar/dev
fix combined setup
2 parents b27da21 + c82ca67 commit 567c049

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Setup/Invoke-ExecCombinedSetup.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ function Invoke-ExecCombinedSetup {
8585
if ($Request.Body.tenantId) { $Secret.TenantId = $Request.Body.tenantid }
8686
if ($Request.Body.applicationId) { $Secret.ApplicationId = $Request.Body.applicationId }
8787
if ($Request.Body.ApplicationSecret) { $Secret.ApplicationSecret = $Request.Body.ApplicationSecret }
88+
if ($Request.Body.RefreshToken) { $Secret.RefreshToken = $Request.Body.RefreshToken }
8889
Add-CIPPAzDataTableEntity @DevSecretsTable -Entity $Secret -Force
8990
$Results.add('Manual credentials have been set in the DevSecrets table.')
9091
} else {
@@ -100,6 +101,10 @@ function Invoke-ExecCombinedSetup {
100101
Set-AzKeyVaultSecret -VaultName $kv -Name 'applicationsecret' -SecretValue (ConvertTo-SecureString -String $Request.Body.applicationSecret -AsPlainText -Force)
101102
$Results.add('Set application secret in Key Vault.')
102103
}
104+
if ($Request.Body.RefreshToken) {
105+
Set-AzKeyVaultSecret -VaultName $kv -Name 'refreshtoken' -SecretValue (ConvertTo-SecureString -String $Request.Body.RefreshToken -AsPlainText -Force)
106+
$Results.add('Set refresh token in Key Vault.')
107+
}
103108
}
104109

105110
$Results.add('Manual credentials setup has been completed.')

0 commit comments

Comments
 (0)