Add browser auth for headless runs

This commit is contained in:
2026-04-08 16:09:30 +02:00
parent c803a00df7
commit 239e3ec16e
12 changed files with 222 additions and 19 deletions

View File

@@ -17,6 +17,9 @@ function Initialize-IntuneManagementRuntime
[string]$AppId,
[string]$Secret,
[string]$Certificate,
[ValidateSet("AppOnly","Browser")]
[string]$AuthMode = "AppOnly",
[string]$RedirectUri,
[string]$GraphEnvironment,
[string]$GCCType
)
@@ -30,6 +33,8 @@ function Initialize-IntuneManagementRuntime
$global:AzureAppId = $AppId
$global:ClientSecret = $Secret
$global:ClientCert = $Certificate
$global:HeadlessAuthMode = $AuthMode
$global:MSALRedirectUri = $RedirectUri
$global:UseGraphEnvironment = $GraphEnvironment
$global:UseGCCType = $GCCType
$global:UseJSonSettings = ($JSonSettings -eq $true)
@@ -68,6 +73,10 @@ function Initialize-IntuneManagementRuntime
{
Write-Host "Using Azure App Certificate"
}
elseif($global:HeadlessAuthMode -eq "Browser")
{
Write-Host "Using browser authentication"
}
else
{
Write-Warning "Azure App Secret or Certificate is missing. Use -Secret <Secret> or -Certificate <Certificate>."