Skip to content

Commit 84e747d

Browse files
changes for kv
1 parent 869354a commit 84e747d

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Function Invoke-ExecUpdateRefreshToken {
3333
Set-AzKeyVaultSecret -VaultName $kv -Name 'RefreshToken' -SecretValue (ConvertTo-SecureString -String $Request.body.refreshtoken -AsPlainText -Force)
3434
} else {
3535
Write-Host "$($env:TenantID) does not match $($Request.body.tenantId) - we're adding a new secret for the tenant."
36-
$name = $Request.body.tenantId -replace '-', '_'
36+
$name = $Request.body.tenantId
3737
try {
3838
Set-AzKeyVaultSecret -VaultName $kv -Name $name -SecretValue (ConvertTo-SecureString -String $Request.body.refreshtoken -AsPlainText -Force)
3939
} catch {

Modules/CIPPCore/Public/Get-CIPPAuthentication.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ function Get-CIPPAuthentication {
5757
$tenants = Get-CIPPAzDataTableEntity @TenantsTable -Filter $Filter
5858
if ($tenants) {
5959
$tenants | ForEach-Object {
60-
$name = $_.tenantId -replace '-', '_'
60+
$name = $_.tenantId
6161
$secret = Get-AzKeyVaultSecret -VaultName $keyvaultname -Name $name -AsPlainText -ErrorAction Stop
6262
if ($secret) {
63-
#set the name back to the original tenantId
6463
$name = $_.customerId
6564
Set-Item -Path env:$name -Value $secret -Force
6665
}

Modules/CIPPCore/Public/GraphHelper/Get-GraphToken.ps1

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ function Get-GraphToken($tenantid, $scope, $AsApp, $AppID, $AppSecret, $refreshT
1010
$Filter = "PartitionKey eq 'AppCache' and RowKey eq 'AppCache'"
1111
$AppCache = Get-CIPPAzDataTableEntity @ConfigTable -Filter $Filter
1212
#force auth update is appId is not the same as the one in the environment variable.
13-
Write-Host "My appId pre-launch is $($env:ApplicationID) and the one in the cache is $($AppCache.ApplicationId)"
1413
if ($AppCache.ApplicationId -and $env:ApplicationID -ne $AppCache.ApplicationId) {
1514
Write-Host "Setting environment variable ApplicationID to $($AppCache.ApplicationId)"
1615
$CIPPAuth = Get-CIPPAuthentication
1716
}
18-
Write-Host "My appId post-launch is $($env:ApplicationID) and the one in the cache is $($AppCache.ApplicationId)"
1917
$refreshToken = $env:RefreshToken
2018
if (!$tenantid) { $tenantid = $env:TenantID }
2119
#Get list of tenants that have 'directTenant' set to true

0 commit comments

Comments
 (0)