diff --git a/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Setup/Invoke-ExecCombinedSetup.ps1 b/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Setup/Invoke-ExecCombinedSetup.ps1 index 3fa7ac8df368..318a311cbc79 100644 --- a/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Setup/Invoke-ExecCombinedSetup.ps1 +++ b/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Setup/Invoke-ExecCombinedSetup.ps1 @@ -85,6 +85,7 @@ function Invoke-ExecCombinedSetup { if ($Request.Body.tenantId) { $Secret.TenantId = $Request.Body.tenantid } if ($Request.Body.applicationId) { $Secret.ApplicationId = $Request.Body.applicationId } if ($Request.Body.ApplicationSecret) { $Secret.ApplicationSecret = $Request.Body.ApplicationSecret } + if ($Request.Body.RefreshToken) { $Secret.RefreshToken = $Request.Body.RefreshToken } Add-CIPPAzDataTableEntity @DevSecretsTable -Entity $Secret -Force $Results.add('Manual credentials have been set in the DevSecrets table.') } else { @@ -100,6 +101,10 @@ function Invoke-ExecCombinedSetup { Set-AzKeyVaultSecret -VaultName $kv -Name 'applicationsecret' -SecretValue (ConvertTo-SecureString -String $Request.Body.applicationSecret -AsPlainText -Force) $Results.add('Set application secret in Key Vault.') } + if ($Request.Body.RefreshToken) { + Set-AzKeyVaultSecret -VaultName $kv -Name 'refreshtoken' -SecretValue (ConvertTo-SecureString -String $Request.Body.RefreshToken -AsPlainText -Force) + $Results.add('Set refresh token in Key Vault.') + } } $Results.add('Manual credentials setup has been completed.')