Skip to content

Bumps versions for Azure.Identity, Azure.Identity.Broker and Microsoft.Graph.Core #3098

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .azure-pipelines/common-templates/install-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ steps:
- task: UseDotNet@2
displayName: Use .NET SDK
inputs:
debugMode: false
version: 8.x

version: 8.x

- task: NuGetToolInstaller@1
displayName: Install Nuget

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
<Import Project="$(MSBuildThisFileDirectory)..\..\..\Repo.props" />
<PropertyGroup>
<LangVersion>9.0</LangVersion>
<TargetFrameworks>netstandard2.0;net6.0;net472</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net8.0;net472</TargetFrameworks>
<RootNamespace>Microsoft.Graph.PowerShell.Authentication.Core</RootNamespace>
<Version>2.18.0</Version>
<Version>2.25.0</Version>
<!-- Suppress .NET Target Framework Moniker (TFM) Support Build Warnings -->
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
</PropertyGroup>
<PropertyGroup>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.11.4" />
<PackageReference Include="Azure.Identity.Broker" Version="1.1.0" />
<PackageReference Include="Microsoft.Graph.Core" Version="3.1.13" />
<PackageReference Include="Azure.Identity" Version="1.13.2" />
<PackageReference Include="Azure.Identity.Broker" Version="1.2.0" />
<PackageReference Include="Microsoft.Graph.Core" Version="3.2.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ private static async Task<TokenCredential> GetEnvironmentCredentialAsync(IAuthCo
{
if (authContext is null)
throw new AuthenticationException(ErrorConstants.Message.MissingAuthContext);

//There is need for explicitly adding TenantId to the TokenCredentialOptions for EnvironmentCredential due to stricter security requirements.
authContext.TenantId = EnvironmentVariables.TenantId;
var tokenCredentialOptions = new TokenCredentialOptions
{
AuthorityHost = new Uri(GetAuthorityUrl(authContext))
Expand Down Expand Up @@ -207,8 +208,8 @@ public static async Task<AzureIdentityAccessTokenProvider> GetAuthenticationProv
{
if (authContext is null)
throw new AuthenticationException(ErrorConstants.Message.MissingAuthContext);
var tokenCrdential = await GetTokenCredentialAsync(authContext, default).ConfigureAwait(false);
return new AzureIdentityAccessTokenProvider(credential: tokenCrdential, scopes: GetScopes(authContext));
var tokenCredential = await GetTokenCredentialAsync(authContext, default).ConfigureAwait(false);
return new AzureIdentityAccessTokenProvider(credential:tokenCredential, observabilityOptions: null,isCaeEnabled: true,scopes: GetScopes(authContext));
}

public static async Task<IAuthContext> AuthenticateAsync(IAuthContext authContext, CancellationToken cancellationToken)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<TargetFrameworks>net8.0;net472</TargetFrameworks>
<IsPackable>false</IsPackable>
<Version>2.8.0</Version>
<Version>2.25.0</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
<!-- As described in this post https://devblogs.microsoft.com/powershell/depending-on-the-right-powershell-nuget-package-in-your-net-project, reference the SDK for dotnetcore-->
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.4.3" PrivateAssets="all" Condition="'$(TargetFramework)' == 'net6.0'" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.5.0" PrivateAssets="all" Condition="'$(TargetFramework)' == 'net8.0'" />
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
Expand Down
3 changes: 1 addition & 2 deletions src/Authentication/Authentication/Helpers/HttpHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ private static HttpClient GetGraphHttpClient(AzureIdentityAccessTokenProvider au
new NationalCloudHandler(),
new ODataQueryOptionsHandler(),
new HttpVersionHandler(),
new CompressionHandler(),
new RetryHandler(new RetryHandlerOption{
Delay = requestContext.RetryDelay,
MaxRetry = requestContext.MaxRetry,
Expand All @@ -69,7 +68,7 @@ private static HttpClient GetGraphHttpClient(AzureIdentityAccessTokenProvider au
: GraphClientFactory.Create(delegatingHandlers, finalHandler: new HttpClientHandler
{
AllowAutoRedirect = false,
AutomaticDecompression = DecompressionMethods.None
AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate
});
httpClient.Timeout = requestContext.ClientTimeout;
return httpClient;
Expand Down
2 changes: 1 addition & 1 deletion src/Authentication/Authentication/build-module.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ $ErrorActionPreference = 'Stop'
$ModuleName = "Authentication"
$ModulePrefix = "Microsoft.Graph"
$netStandard = "netstandard2.0"
$netApp = "net6.0"
$netApp = "net8.0"
$netFx = "net472"
$copyExtensions = @('.dll', '.pdb')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ BeforeAll {
$ModulePath = Join-Path $PSScriptRoot "..\artifacts\$ModuleName.psd1"
Import-Module $ModulePath -Force
$RandomClientId = (New-Guid).Guid

$AvailableAzModule = Get-Module Az.Accounts -ListAvailable
if ($AvailableAzModule.Count -lt 1) {
Install-Module Az.Accounts -Repository PSGallery -Scope CurrentUser -Force -AllowClobber
}
Install-Module Az.Accounts -Repository PSGallery -Scope CurrentUser -Force -AllowClobber
}
Describe 'Connect-MgGraph ParameterSets' {
BeforeAll {
Expand Down Expand Up @@ -81,7 +77,7 @@ Describe 'Connect-MgGraph In Environment Variable Mode' {
$Env:AZURE_CLIENT_SECRET = "Not_Valid"
$Env:AZURE_TENANT_ID = "common"
Connect-MgGraph -EnvironmentVariable -ErrorAction Stop
} | Should -Throw -ExpectedMessage "*ClientSecretCredential authentication failed: AADSTS700016: Application with identifier 'Not_Valid' was not found in the directory 'Microsoft'.*"
} | Should -Throw -ExpectedMessage "ClientSecretCredential authentication failed: "
}
}

Expand All @@ -99,7 +95,7 @@ Describe 'Connect-MgGraph In App Mode' {
Describe 'Connect-MgGraph Dependency Resolution' {
It 'Should load Mg module side by side with Az module.' {
{ Connect-AzAccount -ApplicationId $RandomClientId -CertificateThumbprint "Invalid" -Tenant "Invalid" -ErrorAction Stop } | Should -Throw -ExpectedMessage "*Could not find tenant id*"
{ Connect-MgGraph -TenantId "thisdomaindoesnotexist.com" -ErrorAction Stop -UseDeviceAuthentication } | Should -Throw -ExpectedMessage "*AADSTS90002*"
{ Connect-MgGraph -TenantId "thisdomaindoesnotexist.com" -ErrorAction Stop -UseDeviceAuthentication } | Should -Throw -ExpectedMessage "DeviceCodeCredential authentication failed: "
}
}

Expand Down
Loading