Add browser auth for headless runs
This commit is contained in:
@@ -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>."
|
||||
|
||||
Reference in New Issue
Block a user