Skip to content

Commit

Permalink
Merge pull request #5720 from FabienTschanz/fix/auth-properties
Browse files Browse the repository at this point in the history
Update authentication properties
  • Loading branch information
NikCharlebois authored Feb 12, 2025
2 parents 6344857 + d49bad2 commit 9c09427
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 16 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
for null values.
* EXORetentionPolicyTag
* Initial release.
* EXOSmtpDaneInbound
* Updated authentication properties to align with MOF definition.
FIXES [#5709](https://github.com/microsoft/Microsoft365DSC/issues/5709)
* MISC
* PowerPlatform resource revamp to use direct REST API calls.
* DEPENDENCIES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,21 @@ function Get-TargetResource
[System.String]
$CertificateThumbprint,

[Parameter()]
[System.String]
$CertificatePath,

[Parameter()]
[System.Management.Automation.PSCredential]
$ApplicationSecret
$CertificatePassword,

[Parameter()]
[Switch]
$ManagedIdentity,

[Parameter()]
[System.String[]]
$AccessTokens
)

New-M365DSCConnection -Workload 'ExchangeOnline' `
Expand Down Expand Up @@ -65,9 +77,12 @@ function Get-TargetResource
Ensure = 'Present'
Credential = $Credential
ApplicationId = $ApplicationId
TenantId = $TenantId
CertificateThumbprint = $CertificateThumbprint
ApplicationSecret = $ApplicationSecret
CertificatePath = $CertificatePath
CertificatePassword = $CertificatePassword
Managedidentity = $ManagedIdentity.IsPresent
TenantId = $TenantId
AccessTokens = $AccessTokens
}
return [System.Collections.Hashtable] $results
}
Expand Down Expand Up @@ -113,9 +128,21 @@ function Set-TargetResource
[System.String]
$CertificateThumbprint,

[Parameter()]
[System.String]
$CertificatePath,

[Parameter()]
[System.Management.Automation.PSCredential]
$ApplicationSecret
$CertificatePassword,

[Parameter()]
[Switch]
$ManagedIdentity,

[Parameter()]
[System.String[]]
$AccessTokens
)

New-M365DSCConnection -Workload 'ExchangeOnline' `
Expand Down Expand Up @@ -188,9 +215,21 @@ function Test-TargetResource
[System.String]
$CertificateThumbprint,

[Parameter()]
[System.String]
$CertificatePath,

[Parameter()]
[System.Management.Automation.PSCredential]
$ApplicationSecret
$CertificatePassword,

[Parameter()]
[Switch]
$ManagedIdentity,

[Parameter()]
[System.String[]]
$AccessTokens
)

#Ensure the proper dependencies are installed in the current environment.
Expand Down Expand Up @@ -243,16 +282,24 @@ function Export-TargetResource
$TenantId,

[Parameter()]
[System.Management.Automation.PSCredential]
$ApplicationSecret,
[System.String]
$CertificateThumbprint,

[Parameter()]
[System.String]
$CertificateThumbprint,
$CertificatePath,

[Parameter()]
[System.Management.Automation.PSCredential]
$CertificatePassword,

[Parameter()]
[Switch]
$ManagedIdentity
$ManagedIdentity,

[Parameter()]
[System.String[]]
$AccessTokens
)

$ConnectionMode = New-M365DSCConnection -Workload 'ExchangeOnline' `
Expand Down Expand Up @@ -298,14 +345,16 @@ function Export-TargetResource
}
Write-Host " |---[$i/$($getValue.Count)] $displayedKey" -NoNewline
$params = @{
DomainName = $config.DomainName
Ensure = 'Present'
Credential = $Credential
ApplicationId = $ApplicationId
TenantId = $TenantId
DomainName = $config.DomainName
Ensure = 'Present'
Credential = $Credential
ApplicationId = $ApplicationId
CertificateThumbprint = $CertificateThumbprint
ApplicationSecret = $ApplicationSecret

CertificatePath = $CertificatePath
CertificatePassword = $CertificatePassword
Managedidentity = $ManagedIdentity.IsPresent
TenantId = $TenantId
AccessTokens = $AccessTokens
}

$Results = Get-TargetResource @Params
Expand Down

0 comments on commit 9c09427

Please sign in to comment.