You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Get-Authentication method is failing with the new AzureAD modules. This is because there is no AcquireToken() method available anymore.
You need to replace it with the following method, keeping everything else the same.
### <summary>
### Gets the authentication result to key vaults.
### </summary>
function Get-Authentication
{
# Vault resources endpoint
$ArmResource = "https://vault.azure.net"
# Well known client ID for AzurePowerShell used to authenticate scripts to Azure AD.
$ClientId = "1950a258-227b-4e31-a9cf-717495945fc2"
$RedirectUri = "urn:ietf:wg:oauth:2.0:oob"
$AuthorityUri = "https://login.windows.net/$TenantId"
$AuthContext = New-Object "Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext" `
-ArgumentList $AuthorityUri
$PlatformParameters = New-Object "Microsoft.IdentityModel.Clients.ActiveDirectory.PlatformParameters" `
-ArgumentList "Auto", $null
$AuthResult = $AuthContext.AcquireTokenAsync($ArmResource, $ClientId, $RedirectUri, $PlatformParameters)
return $AuthResult.Result
}
This uses the method AcquireTokenAsync() which requires an additional parameter - PlatformParameters object.
This has been tested with AzureAD modules - 2.0.1.16 and 2.0.2.16
The Get-Authentication method is failing with the new AzureAD modules. This is because there is no
AcquireToken()
method available anymore.You need to replace it with the following method, keeping everything else the same.
This uses the method
AcquireTokenAsync()
which requires an additional parameter - PlatformParameters object.This has been tested with AzureAD modules - 2.0.1.16 and 2.0.2.16
Originally posted by @punit1396 in #1 (comment)
The text was updated successfully, but these errors were encountered: