Skip to content

Commit bd4b626

Browse files
jmprieurpmaytak
andauthored
Adopting Microsoft.Identity.Abstractions 9.3.0 and using the new IAuthenticationSchemeInformationProvider interface (#3447)
* Move interface * Uddate changelog * Updating changelog and version * Fixing tests (order services) * Apply suggestion from @pmaytak Co-authored-by: Peter <34331512+pmaytak@users.noreply.github.com> * Update Directory.Build.props * Update changelog.md --------- Co-authored-by: Peter <34331512+pmaytak@users.noreply.github.com>
1 parent 2b7107c commit bd4b626

21 files changed

+86
-55
lines changed

Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<!--This should be passed from the VSTS build-->
44
<!-- This needs to be greater than or equal to the validation baseline version -->
5-
<MicrosoftIdentityWebVersion Condition="'$(MicrosoftIdentityWebVersion)' == ''">3.12.0</MicrosoftIdentityWebVersion>
5+
<MicrosoftIdentityWebVersion Condition="'$(MicrosoftIdentityWebVersion)' == ''">3.13.0</MicrosoftIdentityWebVersion>
66
<!--This will generate AssemblyVersion, AssemblyFileVersion and AssemblyInformationVersion-->
77
<Version>$(MicrosoftIdentityWebVersion)</Version>
88

@@ -87,7 +87,7 @@
8787
<AzureSecurityKeyVaultCertificatesVersion>4.6.0</AzureSecurityKeyVaultCertificatesVersion>
8888
<MicrosoftGraphVersion>4.36.0</MicrosoftGraphVersion>
8989
<MicrosoftGraphBetaVersion>4.57.0-preview</MicrosoftGraphBetaVersion>
90-
<MicrosoftIdentityAbstractionsVersion>9.2.0</MicrosoftIdentityAbstractionsVersion>
90+
<MicrosoftIdentityAbstractionsVersion>9.3.0</MicrosoftIdentityAbstractionsVersion>
9191
<!--CVE-2024-43485-->
9292
<SystemTextJsonVersion>8.0.5</SystemTextJsonVersion>
9393
<!--CVE-2023-29331-->

changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
3.12.1
1+
3.13.0
22
=======
33
### Dependencies updates
44
- Microsoft.IdentityModel updated to version [8.13.1](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/releases/tag/8.13.1).
5+
- Microsoft.Abstractions updated to version [9.3.0](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/releases/tag/9.3.) and using IAuthenticationSchemeInformationProvider from that library, deprecating the interface of the same name in Microsoft.Identity.Web (introduced in 3.12.0).
56

67
### Bug fixes
78
- Fixed an issue with instantiation of TokenAcquirerFactory when AppContext.BaseDirectory is root path. See PR [#3443](https://github.com/AzureAD/microsoft-identity-web/pull/3443) for details.

src/Microsoft.Identity.Web.AgentIdentities/AgentUserIdentityMsalAddIn.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ internal static Task OnBeforeUserFicForAgentUserIdentityAsync(
3535
{
3636
// Get the services from the service provider.
3737
ITokenAcquirerFactory tokenAcquirerFactory = serviceProvider.GetRequiredService<ITokenAcquirerFactory>();
38-
IAuthenticationSchemeInformationProvider authenticationSchemeInformationProvider =
39-
serviceProvider.GetRequiredService<IAuthenticationSchemeInformationProvider>();
38+
Abstractions.IAuthenticationSchemeInformationProvider authenticationSchemeInformationProvider =
39+
serviceProvider.GetRequiredService<Abstractions.IAuthenticationSchemeInformationProvider>();
4040
IOptionsMonitor<MicrosoftIdentityApplicationOptions> optionsMonitor =
4141
serviceProvider.GetRequiredService<IOptionsMonitor<MicrosoftIdentityApplicationOptions>>();
4242

src/Microsoft.Identity.Web.Azure/MicrosoftIdentityTokenCredential.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ namespace Microsoft.Identity.Web
1616
public class MicrosoftIdentityTokenCredential : TokenCredential
1717
{
1818
private readonly ITokenAcquirerFactory _tokenAcquirerFactory;
19-
private readonly IAuthenticationSchemeInformationProvider _authenticationSchemeInformationProvider;
19+
private readonly Abstractions.IAuthenticationSchemeInformationProvider _authenticationSchemeInformationProvider;
2020

2121
/// <summary>
2222
/// Constructor from an ITokenAcquisition service.
2323
/// </summary>
2424
/// <param name="tokenAcquirerFactory">Token acquisition factory</param>
2525
/// <param name="authenticationSchemeInformationProvider">Host for the token acquisition</param>
26-
public MicrosoftIdentityTokenCredential(ITokenAcquirerFactory tokenAcquirerFactory, IAuthenticationSchemeInformationProvider authenticationSchemeInformationProvider)
26+
public MicrosoftIdentityTokenCredential(ITokenAcquirerFactory tokenAcquirerFactory, Abstractions.IAuthenticationSchemeInformationProvider authenticationSchemeInformationProvider)
2727
{
2828
_tokenAcquirerFactory = tokenAcquirerFactory ?? throw new System.ArgumentNullException(nameof(tokenAcquirerFactory));
2929
_authenticationSchemeInformationProvider = authenticationSchemeInformationProvider ?? throw new System.ArgumentNullException(nameof(authenticationSchemeInformationProvider));

src/Microsoft.Identity.Web.Azure/PublicAPI.Unshipped.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#nullable enable
22
Microsoft.Identity.Web.MicrosoftIdentityTokenCredential
3-
Microsoft.Identity.Web.MicrosoftIdentityTokenCredential.MicrosoftIdentityTokenCredential(Microsoft.Identity.Abstractions.ITokenAcquirerFactory! tokenAcquirerFactory, Microsoft.Identity.Web.IAuthenticationSchemeInformationProvider! authenticationSchemeInformationProvider) -> void
3+
Microsoft.Identity.Web.MicrosoftIdentityTokenCredential.MicrosoftIdentityTokenCredential(Microsoft.Identity.Abstractions.ITokenAcquirerFactory! tokenAcquirerFactory, Microsoft.Identity.Abstractions.IAuthenticationSchemeInformationProvider! authenticationSchemeInformationProvider) -> void
44
Microsoft.Identity.Web.MicrosoftIdentityTokenCredential.Options.get -> Microsoft.Identity.Abstractions.AuthorizationHeaderProviderOptions!
55
Microsoft.Identity.Web.ServiceCollectionExtensionForAzureCreds
66
override Microsoft.Identity.Web.MicrosoftIdentityTokenCredential.GetToken(Azure.Core.TokenRequestContext requestContext, System.Threading.CancellationToken cancellationToken) -> Azure.Core.AccessToken
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4+
using System;
5+
46
namespace Microsoft.Identity.Web
57
{
68
/// <summary>
79
/// Provides information about the effective authentication scheme. If passing null
810
/// or string.Empty, this returns the default authentication scheme.
911
/// </summary>
10-
public interface IAuthenticationSchemeInformationProvider
12+
[Obsolete("This interface is obsolete and will be removed in a future version. Use Microsoft.Identity.Abstractions.IAuthenticationSchemeInformationProvider instead.")]
13+
public interface IAuthenticationSchemeInformationProvider : Abstractions.IAuthenticationSchemeInformationProvider
1114

1215
{
13-
/// <summary>
14-
/// Get the effective authentication scheme based on the provided authentication scheme.
15-
/// </summary>
16-
/// <param name="authenticationScheme">intended authentication scheme.</param>
17-
/// <returns>Effective authentication scheme (default authentication scheme if the intended
18-
/// authentication scheme is null or an empty string.</returns>
19-
string GetEffectiveAuthenticationScheme(string? authenticationScheme);
2016
}
2117
}

src/Microsoft.Identity.Web.TokenAcquisition/ITokenAcquisitionHost.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace Microsoft.Identity.Web
1010
{
1111

12-
internal interface ITokenAcquisitionHost : IAuthenticationSchemeInformationProvider
12+
internal interface ITokenAcquisitionHost : Abstractions.IAuthenticationSchemeInformationProvider
1313
{
1414
MergedOptions GetOptions(string? authenticationScheme, out string effectiveAuthenticationScheme);
1515

src/Microsoft.Identity.Web.TokenAcquisition/PublicAPI/net462/PublicAPI.Unshipped.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#nullable enable
22
Microsoft.Identity.Web.BeforeTokenAcquisitionForTestUserAsync
33
Microsoft.Identity.Web.IAuthenticationSchemeInformationProvider
4-
Microsoft.Identity.Web.IAuthenticationSchemeInformationProvider.GetEffectiveAuthenticationScheme(string? authenticationScheme) -> string!
54
Microsoft.Identity.Web.TokenAcquirerExtensions
65
Microsoft.Identity.Web.TokenAcquisitionExtensionOptions.OnBeforeTokenAcquisitionForTestUserAsync -> Microsoft.Identity.Web.BeforeTokenAcquisitionForTestUserAsync?
76
static Microsoft.Identity.Web.TokenAcquirerExtensions.GetFicTokenAsync(this Microsoft.Identity.Abstractions.ITokenAcquirer! tokenAcquirer, Microsoft.Identity.Abstractions.AcquireTokenOptions? options = null, string? clientAssertion = null, string! scope = "api://AzureAdTokenExchange/.default", System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task<Microsoft.Identity.Abstractions.AcquireTokenResult!>!

src/Microsoft.Identity.Web.TokenAcquisition/PublicAPI/net472/PublicAPI.Unshipped.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#nullable enable
22
Microsoft.Identity.Web.BeforeTokenAcquisitionForTestUserAsync
33
Microsoft.Identity.Web.IAuthenticationSchemeInformationProvider
4-
Microsoft.Identity.Web.IAuthenticationSchemeInformationProvider.GetEffectiveAuthenticationScheme(string? authenticationScheme) -> string!
54
Microsoft.Identity.Web.TokenAcquirerExtensions
65
Microsoft.Identity.Web.TokenAcquisitionExtensionOptions.OnBeforeTokenAcquisitionForTestUserAsync -> Microsoft.Identity.Web.BeforeTokenAcquisitionForTestUserAsync?
76
static Microsoft.Identity.Web.TokenAcquirerExtensions.GetFicTokenAsync(this Microsoft.Identity.Abstractions.ITokenAcquirer! tokenAcquirer, Microsoft.Identity.Abstractions.AcquireTokenOptions? options = null, string? clientAssertion = null, string! scope = "api://AzureAdTokenExchange/.default", System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task<Microsoft.Identity.Abstractions.AcquireTokenResult!>!

src/Microsoft.Identity.Web.TokenAcquisition/PublicAPI/net6.0/PublicAPI.Unshipped.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#nullable enable
22
Microsoft.Identity.Web.BeforeTokenAcquisitionForTestUserAsync
33
Microsoft.Identity.Web.IAuthenticationSchemeInformationProvider
4-
Microsoft.Identity.Web.IAuthenticationSchemeInformationProvider.GetEffectiveAuthenticationScheme(string? authenticationScheme) -> string!
54
Microsoft.Identity.Web.TokenAcquirerExtensions
65
Microsoft.Identity.Web.TokenAcquisitionExtensionOptions.OnBeforeTokenAcquisitionForTestUserAsync -> Microsoft.Identity.Web.BeforeTokenAcquisitionForTestUserAsync?
76
static Microsoft.Identity.Web.TokenAcquirerExtensions.GetFicTokenAsync(this Microsoft.Identity.Abstractions.ITokenAcquirer! tokenAcquirer, Microsoft.Identity.Abstractions.AcquireTokenOptions? options = null, string? clientAssertion = null, string! scope = "api://AzureAdTokenExchange/.default", System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task<Microsoft.Identity.Abstractions.AcquireTokenResult!>!

0 commit comments

Comments
 (0)