From 57d14329476e91a5cc0fc47b583a7822bbc90575 Mon Sep 17 00:00:00 2001 From: Jason Thompson Date: Thu, 15 Oct 2020 22:58:09 -0400 Subject: [PATCH] Update library to 4.21.0 --- packages.config | 2 +- src/Get-MsalToken.ps1 | 4 ++-- src/MSAL.PS.psd1 | 6 +++--- src/New-MsalClientApplication.ps1 | 8 +++++++- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/packages.config b/packages.config index a51e988..d35f232 100644 --- a/packages.config +++ b/packages.config @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/src/Get-MsalToken.ps1 b/src/Get-MsalToken.ps1 index 805f280..a1acf85 100644 --- a/src/Get-MsalToken.ps1 +++ b/src/Get-MsalToken.ps1 @@ -176,7 +176,7 @@ function Get-MsalToken { # Modifies the token acquisition request so that the acquired token is a Proof of Possession token (PoP), rather than a Bearer token. [Parameter(Mandatory = $false)] - [System.Net.Http.HttpRequestMessage] $WithProofOfPosession, + [System.Net.Http.HttpRequestMessage] $ProofOfPossession, # Ignore any access token in the user token cache and attempt to acquire new access token using the refresh token for the account if one is available. [Parameter(Mandatory = $false, ParameterSetName = 'PublicClient')] @@ -329,7 +329,7 @@ function Get-MsalToken { if ($Authority) { [void] $AquireTokenParameters.WithAuthority($Authority.AbsoluteUri) } if ($CorrelationId) { [void] $AquireTokenParameters.WithCorrelationId($CorrelationId) } if ($ExtraQueryParameters) { [void] $AquireTokenParameters.WithExtraQueryParameters((ConvertTo-Dictionary $ExtraQueryParameters -KeyType ([string]) -ValueType ([string]))) } - if ($WithProofOfPosession) { [void] $AquireTokenParameters.WithProofOfPosession($WithProofOfPosession) } + if ($ProofOfPossession) { [void] $AquireTokenParameters.WithProofOfPosession($ProofOfPossession) } Write-Debug ('Aquiring Token for Application with ClientId [{0}]' -f $ClientApplication.ClientId) if (!$Timeout) { $Timeout = [timespan]::Zero } diff --git a/src/MSAL.PS.psd1 b/src/MSAL.PS.psd1 index 9ffd19c..dbdf777 100644 --- a/src/MSAL.PS.psd1 +++ b/src/MSAL.PS.psd1 @@ -10,7 +10,7 @@ RootModule = 'MSAL.PS.psm1' # Version number of this module. -ModuleVersion = '4.19.0' +ModuleVersion = '4.21.0' # Supported PSEditions CompatiblePSEditions = 'Core','Desktop' @@ -115,8 +115,8 @@ AliasesToExport = @() # List of all files packaged with this module FileList = @( - '..\build\packages\Microsoft.Identity.Client.4.19.0\lib\netcoreapp2.1\Microsoft.Identity.Client.dll' - '..\build\packages\Microsoft.Identity.Client.4.19.0\lib\net45\Microsoft.Identity.Client.dll' + '..\build\packages\Microsoft.Identity.Client.4.21.0\lib\netcoreapp2.1\Microsoft.Identity.Client.dll' + '..\build\packages\Microsoft.Identity.Client.4.21.0\lib\net45\Microsoft.Identity.Client.dll' #'..\build\packages\System.Security.Cryptography.ProtectedData.4.7.0\lib\netstandard1.3\System.Security.Cryptography.ProtectedData.dll' '.\TokenCacheHelper.cs' '.\DeviceCodeHelper.cs' diff --git a/src/New-MsalClientApplication.ps1 b/src/New-MsalClientApplication.ps1 index 47399b2..5e51627 100644 --- a/src/New-MsalClientApplication.ps1 +++ b/src/New-MsalClientApplication.ps1 @@ -60,6 +60,10 @@ function New-MsalClientApplication { # Address of the authority to issue token. [Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true)] [uri] $Authority, + # Use Platform Authentication Broker + #[Parameter(Mandatory = $false, ParameterSetName = 'PublicClient', ValueFromPipelineByPropertyName = $true)] + #[Parameter(Mandatory = $false, ParameterSetName = 'PublicClient-InputObject', ValueFromPipelineByPropertyName = $true)] + #[switch] $AuthenticationBroker, # Sets Extra Query Parameters for the query string in the HTTP authentication request. [Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true)] [hashtable] $ExtraQueryParameters, @@ -89,8 +93,10 @@ function New-MsalClientApplication { $ClientApplicationBuilder = [Microsoft.Identity.Client.PublicClientApplicationBuilder]::Create($ClientId) } + if ($PSBoundParameters.ContainsKey('EnableExperimentalFeatures')) { [void] $ClientApplicationBuilder.WithExperimentalFeatures($EnableExperimentalFeatures) } # Must be called before other experimental features if ($RedirectUri) { [void] $ClientApplicationBuilder.WithRedirectUri($RedirectUri.AbsoluteUri) } elseif (!$PublicClientOptions -or !$PublicClientOptions.RedirectUri) { [void] $ClientApplicationBuilder.WithDefaultRedirectUri() } + if ($PSBoundParameters.ContainsKey('AuthenticationBroker')) { [void] $ClientApplicationBuilder.WithBroker($AuthenticationBroker) } $ClientOptions = $PublicClientOptions } @@ -102,6 +108,7 @@ function New-MsalClientApplication { $ClientApplicationBuilder = [Microsoft.Identity.Client.ConfidentialClientApplicationBuilder]::Create($ClientId) } + if ($PSBoundParameters.ContainsKey('EnableExperimentalFeatures')) { [void] $ClientApplicationBuilder.WithExperimentalFeatures($EnableExperimentalFeatures) } # Must be called before other experimental features if ($ClientSecret) { [void] $ClientApplicationBuilder.WithClientSecret((ConvertFrom-SecureStringAsPlainText $ClientSecret -Force)) } if ($ClientAssertion) { [void] $ClientApplicationBuilder.WithClientAssertion($ClientAssertion) } if ($ClientClaims) { [void] $ClientApplicationBuilder.WithClientClaims($ClientCertificate, (ConvertTo-Dictionary $ClientClaims -KeyType ([string]) -ValueType ([string]))) } @@ -120,7 +127,6 @@ function New-MsalClientApplication { [void] $ClientApplicationBuilder.WithClientVersion($PSVersionTable.PSVersion) } if ($ExtraQueryParameters) { [void] $ClientApplicationBuilder.WithExtraQueryParameters((ConvertTo-Dictionary $ExtraQueryParameters -KeyType ([string]) -ValueType ([string]))) } - if ($PSBoundParameters.ContainsKey('EnableExperimentalFeatures')) { [void] $ClientApplicationBuilder.WithExperimentalFeatures($EnableExperimentalFeatures) } #[void] $ClientApplicationBuilder.WithLogging($null, [Microsoft.Identity.Client.LogLevel]::Verbose, $false, $true) $ClientApplication = $ClientApplicationBuilder.Build()