mirror of
https://github.com/Micke-K/IntuneManagement.git
synced 2026-11-27 09:22:26 +01:00
Add -Federated switch for GitHub Actions federated credential auth (#440)
Silent and batch runs can now sign in with a GitHub Actions OIDC token instead of a client secret or certificate. With -Federated, the tool requests the token and passes it to MSAL with WithClientAssertion. The access token is reused until it is within five minutes of expiry, so a bulk export signs in once rather than on every Graph request. Secret and certificate sign-in are unchanged. Contributed by @mattskare.
This commit is contained in:
@@ -1405,7 +1405,7 @@ function Invoke-InitSilentBatchJob
|
||||
return
|
||||
}
|
||||
|
||||
if(-not $global:AzureAppId -or (-not $global:ClientSecret -and -not $global:ClientCert))
|
||||
if(-not $global:AzureAppId -or (-not $global:ClientSecret -and -not $global:ClientCert -and -not $global:UseFederated))
|
||||
{
|
||||
# Get login info for silent job from settings
|
||||
$global:AzureAppId = Get-SettingValue "GraphAzureAppId" -TenantID $global:TenantId
|
||||
@@ -1419,7 +1419,7 @@ function Invoke-InitSilentBatchJob
|
||||
return
|
||||
}
|
||||
|
||||
if(-not $global:ClientSecret -and -not $global:ClientCert)
|
||||
if(-not $global:ClientSecret -and -not $global:ClientCert -and -not $global:UseFederated)
|
||||
{
|
||||
Write-Log "Secret or Certificate must be specified. Either specify Secret/Certificate in Settings or Command Line" 3
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user