Closed robinmalik closed 1 year ago
Attempting the following and letting all the errors return to the screen: Get-MsalToken -ClientId $ClientId -TenantId $TenantId -Interactive -Scopes 'openid' -Prompt ForceLogin
gives:
New-MsalClientApplication : Cannot convert argument "builder", with value:
"Microsoft.Identity.Client.PublicClientApplicationBuilder", for "WithDesktopFeatures" to type
"Microsoft.Identity.Client.PublicClientApplicationBuilder": "Cannot convert the
"Microsoft.Identity.Client.PublicClientApplicationBuilder" value of type
"Microsoft.Identity.Client.PublicClientApplicationBuilder" to type
"Microsoft.Identity.Client.PublicClientApplicationBuilder"."
At C:\Program Files\WindowsPowerShell\Modules\MSAL.PS\4.37.0.0\Select-MsalClientApplication.ps1:56 char:29
+ ... plication = New-MsalClientApplication -ErrorAction Stop @paramNewMsal ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-MsalClientApplication], MethodException
+ FullyQualifiedErrorId : MethodArgumentConversionInvalidCastArgument,New-MsalClientApplication
The property 'AppConfig' cannot be found on this object. Verify that the property exists.
At C:\Program Files\WindowsPowerShell\Modules\MSAL.PS\4.37.0.0\Select-MsalClientApplication.ps1:88 char:9
+ Write-Debug ('Adding Application with ClientId [{0}] and Redi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrict
Add-MsalClientApplication : Cannot bind argument to parameter 'PublicClientApplication' because it is null.
At C:\Program Files\WindowsPowerShell\Modules\MSAL.PS\4.37.0.0\Select-MsalClientApplication.ps1:89 char:35
+ Add-MsalClientApplication $ClientApplication
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Add-MsalClientApplication], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Add-MsalClientApplication
You cannot call a method on a null-valued expression.
At C:\Program Files\WindowsPowerShell\Modules\MSAL.PS\4.37.0.0\Get-MsalToken.ps1:258 char:21
+ ... $AquireTokenParameters = $PublicClientApplication.Acquire ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
You cannot call a method on a null-valued expression.
At C:\Program Files\WindowsPowerShell\Modules\MSAL.PS\4.37.0.0\Get-MsalToken.ps1:264 char:68
+ ... r]::Zero) { [void] $AquireTokenParameters.WithParentActivityOrWindow( ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
You cannot call a method on a null-valued expression.
At C:\Program Files\WindowsPowerShell\Modules\MSAL.PS\4.37.0.0\Get-MsalToken.ps1:268 char:36
+ ... ($Prompt) { [void] $AquireTokenParameters.WithPrompt([Microsoft.Ident ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
The variable '$AquireTokenParameters' cannot be retrieved because it has not been set.
At C:\Program Files\WindowsPowerShell\Modules\MSAL.PS\4.37.0.0\Get-MsalToken.ps1:338 char:45
+ ... elseif ($TenantId) { [void] $AquireTokenParameters.WithAut ...
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (AquireTokenParameters:String) [], RuntimeException
+ FullyQualifiedErrorId : VariableIsUndefined
The property 'ClientId' cannot be found on this object. Verify that the property exists.
At C:\Program Files\WindowsPowerShell\Modules\MSAL.PS\4.37.0.0\Get-MsalToken.ps1:343 char:17
+ ... Write-Debug ('Aquiring Token for Application with ClientI ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrict
The variable '$AquireTokenParameters' cannot be retrieved because it has not been set.
At C:\Program Files\WindowsPowerShell\Modules\MSAL.PS\4.37.0.0\Get-MsalToken.ps1:385 char:280
+ ... lureAuthenticationError' -TargetObject $AquireTokenParameters -ErrorA ...
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (AquireTokenParameters:String) [], RuntimeException
+ FullyQualifiedErrorId : VariableIsUndefined
I've no idea why, but things have started working again. Closing.
same problem here but unfortunately it does not simply disappear by itself
Also seeing the same problem in PowerShell 7.3.x
Hi,
I was working all morning with the following code executing successfully:
And for some reason, I'm now getting the following error:
This happens with both PS
5.1
and7.3.3
using version4.37.0.0
ofMSAL.PS
.PSVersionTable:
I've tried rebooting. Anything else I can look at?
Thank you :)