From b854a4fbfce0e369b6f4add31c184ea6f545b27e Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 27 Jan 2022 14:55:59 -0800 Subject: [PATCH 1/4] Annotate WebAssembly.Authentication Fixes https://github.com/dotnet/aspnetcore/issues/30751 Fixes https://github.com/dotnet/aspnetcore/issues/35162 --- ...lWebAssemblyServiceCollectionExtensions.cs | 7 ++-- ...bly.Authentication.WarningSuppressions.xml | 17 ++++++++++ ...mponents.WebAssembly.Authentication.csproj | 10 ++---- .../src/Models/RemoteAuthenticationContext.cs | 5 ++- .../Options/RemoteAuthenticationOptions.cs | 5 ++- .../src/RemoteAuthenticatorViewCore.cs | 4 ++- .../DefaultRemoteApplicationPathsProvider.cs | 4 ++- .../Services/IRemoteAuthenticationService.cs | 5 ++- .../Services/RemoteAuthenticationService.cs | 3 +- ...thenticationServiceCollectionExtensions.cs | 32 +++++++++++-------- 10 files changed, 63 insertions(+), 29 deletions(-) create mode 100644 src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.WarningSuppressions.xml diff --git a/src/Components/WebAssembly/Authentication.Msal/src/MsalWebAssemblyServiceCollectionExtensions.cs b/src/Components/WebAssembly/Authentication.Msal/src/MsalWebAssemblyServiceCollectionExtensions.cs index 2a778973202c..4632035b1cf7 100644 --- a/src/Components/WebAssembly/Authentication.Msal/src/MsalWebAssemblyServiceCollectionExtensions.cs +++ b/src/Components/WebAssembly/Authentication.Msal/src/MsalWebAssemblyServiceCollectionExtensions.cs @@ -35,7 +35,8 @@ public static IRemoteAuthenticationBuilderThe . /// A callback to configure the . /// The . - public static IRemoteAuthenticationBuilder AddMsalAuthentication(this IServiceCollection services, Action> configure) + public static IRemoteAuthenticationBuilder AddMsalAuthentication<[DynamicallyAccessedMembers(JsonSerialized)] TRemoteAuthenticationState>( + this IServiceCollection services, Action> configure) where TRemoteAuthenticationState : RemoteAuthenticationState, new() { return AddMsalAuthentication(services, configure); @@ -49,7 +50,9 @@ public static IRemoteAuthenticationBuilderThe . /// A callback to configure the . /// The . - public static IRemoteAuthenticationBuilder AddMsalAuthentication(this IServiceCollection services, Action> configure) + public static IRemoteAuthenticationBuilder AddMsalAuthentication< + [DynamicallyAccessedMembers(JsonSerialized)] TRemoteAuthenticationState, [DynamicallyAccessedMembers(JsonSerialized)] TAccount>( + this IServiceCollection services, Action> configure) where TRemoteAuthenticationState : RemoteAuthenticationState, new() where TAccount : RemoteUserAccount { diff --git a/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.WarningSuppressions.xml b/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.WarningSuppressions.xml new file mode 100644 index 000000000000..358d7fae2dda --- /dev/null +++ b/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.WarningSuppressions.xml @@ -0,0 +1,17 @@ + + + + + ILLink + IL2091 + member + F:Microsoft.Extensions.DependencyInjection.WebAssemblyAuthenticationServiceCollectionExtensions.<>c__1`1.<>9__1_0 + + + ILLink + IL2091 + member + M:Microsoft.Extensions.DependencyInjection.WebAssemblyAuthenticationServiceCollectionExtensions.<>c__1`1.<AddAuthenticationStateProvider>b__1_0(System.IServiceProvider) + + + diff --git a/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj b/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj index 2237631844a4..d605404038b0 100644 --- a/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj +++ b/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj @@ -7,6 +7,7 @@ Build client-side authentication for single-page applications (SPAs). true true + true disable @@ -75,14 +76,7 @@ <_InteropBuildOutput Include="$(YarnWorkingDir)dist\$(Configuration)\**" Exclude="$(YarnWorkingDir)dist\.gitignore" /> - + diff --git a/src/Components/WebAssembly/WebAssembly.Authentication/src/Models/RemoteAuthenticationContext.cs b/src/Components/WebAssembly/WebAssembly.Authentication/src/Models/RemoteAuthenticationContext.cs index 750ca18f82d0..5ac882e42da9 100644 --- a/src/Components/WebAssembly/WebAssembly.Authentication/src/Models/RemoteAuthenticationContext.cs +++ b/src/Components/WebAssembly/WebAssembly.Authentication/src/Models/RemoteAuthenticationContext.cs @@ -1,13 +1,16 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; +using static Microsoft.AspNetCore.Internal.LinkerFlags; + namespace Microsoft.AspNetCore.Components.WebAssembly.Authentication; /// /// Represents the context during authentication operations. /// /// -public class RemoteAuthenticationContext where TRemoteAuthenticationState : RemoteAuthenticationState +public class RemoteAuthenticationContext<[DynamicallyAccessedMembers(JsonSerialized)] TRemoteAuthenticationState> where TRemoteAuthenticationState : RemoteAuthenticationState { /// /// Gets or sets the url for the current authentication operation. diff --git a/src/Components/WebAssembly/WebAssembly.Authentication/src/Options/RemoteAuthenticationOptions.cs b/src/Components/WebAssembly/WebAssembly.Authentication/src/Options/RemoteAuthenticationOptions.cs index dccda6fa2a00..a8a142bd638a 100644 --- a/src/Components/WebAssembly/WebAssembly.Authentication/src/Options/RemoteAuthenticationOptions.cs +++ b/src/Components/WebAssembly/WebAssembly.Authentication/src/Options/RemoteAuthenticationOptions.cs @@ -1,13 +1,16 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; +using static Microsoft.AspNetCore.Internal.LinkerFlags; + namespace Microsoft.AspNetCore.Components.WebAssembly.Authentication; /// /// Options for remote authentication. /// /// The type of the underlying provider options. -public class RemoteAuthenticationOptions where TRemoteAuthenticationProviderOptions : new() +public class RemoteAuthenticationOptions<[DynamicallyAccessedMembers(JsonSerialized)] TRemoteAuthenticationProviderOptions> where TRemoteAuthenticationProviderOptions : new() { /// /// Gets or sets the provider options. diff --git a/src/Components/WebAssembly/WebAssembly.Authentication/src/RemoteAuthenticatorViewCore.cs b/src/Components/WebAssembly/WebAssembly.Authentication/src/RemoteAuthenticatorViewCore.cs index c0bbfee6cf8c..da65fb0fd161 100644 --- a/src/Components/WebAssembly/WebAssembly.Authentication/src/RemoteAuthenticatorViewCore.cs +++ b/src/Components/WebAssembly/WebAssembly.Authentication/src/RemoteAuthenticatorViewCore.cs @@ -1,9 +1,11 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using Microsoft.AspNetCore.Components.Authorization; using Microsoft.AspNetCore.Components.Rendering; using Microsoft.JSInterop; +using static Microsoft.AspNetCore.Internal.LinkerFlags; namespace Microsoft.AspNetCore.Components.WebAssembly.Authentication; @@ -11,7 +13,7 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.Authentication; /// A component that handles remote authentication operations in an application. /// /// The user state type persisted while the operation is in progress. It must be serializable. -public class RemoteAuthenticatorViewCore : ComponentBase where TAuthenticationState : RemoteAuthenticationState +public class RemoteAuthenticatorViewCore<[DynamicallyAccessedMembers(JsonSerialized)] TAuthenticationState> : ComponentBase where TAuthenticationState : RemoteAuthenticationState { private string _message; private RemoteAuthenticationApplicationPathsOptions _applicationPaths; diff --git a/src/Components/WebAssembly/WebAssembly.Authentication/src/Services/DefaultRemoteApplicationPathsProvider.cs b/src/Components/WebAssembly/WebAssembly.Authentication/src/Services/DefaultRemoteApplicationPathsProvider.cs index 41e8d017d53f..b8f7f440d955 100644 --- a/src/Components/WebAssembly/WebAssembly.Authentication/src/Services/DefaultRemoteApplicationPathsProvider.cs +++ b/src/Components/WebAssembly/WebAssembly.Authentication/src/Services/DefaultRemoteApplicationPathsProvider.cs @@ -1,11 +1,13 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using Microsoft.Extensions.Options; +using static Microsoft.AspNetCore.Internal.LinkerFlags; namespace Microsoft.AspNetCore.Components.WebAssembly.Authentication; -internal class DefaultRemoteApplicationPathsProvider : IRemoteAuthenticationPathsProvider where TProviderOptions : class, new() +internal class DefaultRemoteApplicationPathsProvider<[DynamicallyAccessedMembers(JsonSerialized)] TProviderOptions> : IRemoteAuthenticationPathsProvider where TProviderOptions : class, new() { private readonly IOptions> _options; diff --git a/src/Components/WebAssembly/WebAssembly.Authentication/src/Services/IRemoteAuthenticationService.cs b/src/Components/WebAssembly/WebAssembly.Authentication/src/Services/IRemoteAuthenticationService.cs index c5ae8d36bc85..bdda6a6e193c 100644 --- a/src/Components/WebAssembly/WebAssembly.Authentication/src/Services/IRemoteAuthenticationService.cs +++ b/src/Components/WebAssembly/WebAssembly.Authentication/src/Services/IRemoteAuthenticationService.cs @@ -1,13 +1,16 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; +using static Microsoft.AspNetCore.Internal.LinkerFlags; + namespace Microsoft.AspNetCore.Components.WebAssembly.Authentication; /// /// Represents a contract for services that perform authentication operations for a Blazor WebAssembly application. /// /// The state to be persisted across authentication operations. -public interface IRemoteAuthenticationService +public interface IRemoteAuthenticationService<[DynamicallyAccessedMembers(JsonSerialized)] TRemoteAuthenticationState> where TRemoteAuthenticationState : RemoteAuthenticationState { /// diff --git a/src/Components/WebAssembly/WebAssembly.Authentication/src/Services/RemoteAuthenticationService.cs b/src/Components/WebAssembly/WebAssembly.Authentication/src/Services/RemoteAuthenticationService.cs index a1c67504accf..ad951b43b6eb 100644 --- a/src/Components/WebAssembly/WebAssembly.Authentication/src/Services/RemoteAuthenticationService.cs +++ b/src/Components/WebAssembly/WebAssembly.Authentication/src/Services/RemoteAuthenticationService.cs @@ -16,7 +16,7 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.Authentication; /// The state to preserve across authentication operations. /// The type of the . /// The options to be passed down to the underlying JavaScript library handling the authentication operations. -public class RemoteAuthenticationService : +public class RemoteAuthenticationService<[DynamicallyAccessedMembers(JsonSerialized)] TRemoteAuthenticationState, [DynamicallyAccessedMembers(JsonSerialized)] TAccount, [DynamicallyAccessedMembers(JsonSerialized)] TProviderOptions> : AuthenticationStateProvider, IRemoteAuthenticationService, IAccessTokenProvider @@ -162,6 +162,7 @@ public virtual async ValueTask RequestAccessToken() } /// + [DynamicDependency(JsonSerialized, typeof(AccessTokenRequestOptions))] public virtual async ValueTask RequestAccessToken(AccessTokenRequestOptions options) { if (options is null) diff --git a/src/Components/WebAssembly/WebAssembly.Authentication/src/WebAssemblyAuthenticationServiceCollectionExtensions.cs b/src/Components/WebAssembly/WebAssembly.Authentication/src/WebAssemblyAuthenticationServiceCollectionExtensions.cs index c6aac9bec276..da8c6c92b2b9 100644 --- a/src/Components/WebAssembly/WebAssembly.Authentication/src/WebAssemblyAuthenticationServiceCollectionExtensions.cs +++ b/src/Components/WebAssembly/WebAssembly.Authentication/src/WebAssemblyAuthenticationServiceCollectionExtensions.cs @@ -26,7 +26,8 @@ public static class WebAssemblyAuthenticationServiceCollectionExtensions /// The configuration options of the underlying provider being used for handling the authentication operations. /// The to add the services to. /// The where the services were registered. - public static IRemoteAuthenticationBuilder AddRemoteAuthentication( + public static IRemoteAuthenticationBuilder AddRemoteAuthentication< + [DynamicallyAccessedMembers(JsonSerialized)] TRemoteAuthenticationState, [DynamicallyAccessedMembers(JsonSerialized)] TAccount, [DynamicallyAccessedMembers(JsonSerialized)] TProviderOptions>( this IServiceCollection services) where TRemoteAuthenticationState : RemoteAuthenticationState where TAccount : RemoteUserAccount @@ -35,10 +36,7 @@ public static class WebAssemblyAuthenticationServiceCollectionExtensions services.AddOptions(); services.AddAuthorizationCore(); services.TryAddScoped>(); - services.TryAddScoped(sp => - { - return (IRemoteAuthenticationService)sp.GetRequiredService(); - }); + AddAuthenticationStateProvider(services); services.TryAddTransient(); services.TryAddTransient(); @@ -57,6 +55,12 @@ public static class WebAssemblyAuthenticationServiceCollectionExtensions return new RemoteAuthenticationBuilder(services); } + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2091", Justification = "The calling method enforces the dynamically accessed members constraints.")] + private static void AddAuthenticationStateProvider<[DynamicallyAccessedMembers(JsonSerialized)] TRemoteAuthenticationState>(IServiceCollection services) where TRemoteAuthenticationState : RemoteAuthenticationState + { + services.TryAddScoped(static sp => (IRemoteAuthenticationService)sp.GetRequiredService()); + } + /// /// Adds support for authentication for SPA applications using the given and /// . @@ -67,7 +71,8 @@ public static class WebAssemblyAuthenticationServiceCollectionExtensions /// The to add the services to. /// An action that will configure the . /// The where the services were registered. - public static IRemoteAuthenticationBuilder AddRemoteAuthentication( + public static IRemoteAuthenticationBuilder AddRemoteAuthentication< + [DynamicallyAccessedMembers(JsonSerialized)] TRemoteAuthenticationState, [DynamicallyAccessedMembers(JsonSerialized)] TAccount, [DynamicallyAccessedMembers(JsonSerialized)] TProviderOptions>( this IServiceCollection services, Action> configure) where TRemoteAuthenticationState : RemoteAuthenticationState where TAccount : RemoteUserAccount @@ -101,7 +106,7 @@ public static IRemoteAuthenticationBuilderThe to add the services to. /// An action that will configure the . /// The where the services were registered. - public static IRemoteAuthenticationBuilder AddOidcAuthentication( + public static IRemoteAuthenticationBuilder AddOidcAuthentication<[DynamicallyAccessedMembers(JsonSerialized)] TRemoteAuthenticationState>( this IServiceCollection services, Action> configure) where TRemoteAuthenticationState : RemoteAuthenticationState, new() { @@ -116,7 +121,8 @@ public static IRemoteAuthenticationBuilderThe to add the services to. /// An action that will configure the . /// The where the services were registered. - public static IRemoteAuthenticationBuilder AddOidcAuthentication( + public static IRemoteAuthenticationBuilder AddOidcAuthentication< + [DynamicallyAccessedMembers(JsonSerialized)] TRemoteAuthenticationState, [DynamicallyAccessedMembers(JsonSerialized)] TAccount>( this IServiceCollection services, Action> configure) where TRemoteAuthenticationState : RemoteAuthenticationState, new() where TAccount : RemoteUserAccount @@ -142,7 +148,7 @@ public static IRemoteAuthenticationBuilderThe type of the remote authentication state. /// The to add the services to. /// The where the services were registered. - public static IRemoteAuthenticationBuilder AddApiAuthorization(this IServiceCollection services) + public static IRemoteAuthenticationBuilder AddApiAuthorization<[DynamicallyAccessedMembers(JsonSerialized)] TRemoteAuthenticationState>(this IServiceCollection services) where TRemoteAuthenticationState : RemoteAuthenticationState, new() { return AddApiAuthorizationCore(services, configure: null, Assembly.GetCallingAssembly().GetName().Name); @@ -155,7 +161,7 @@ public static IRemoteAuthenticationBuilderThe account type. /// The to add the services to. /// The where the services were registered. - public static IRemoteAuthenticationBuilder AddApiAuthorization( + public static IRemoteAuthenticationBuilder AddApiAuthorization<[DynamicallyAccessedMembers(JsonSerialized)] TRemoteAuthenticationState, [DynamicallyAccessedMembers(JsonSerialized)] TAccount>( this IServiceCollection services) where TRemoteAuthenticationState : RemoteAuthenticationState, new() where TAccount : RemoteUserAccount @@ -182,7 +188,7 @@ public static IRemoteAuthenticationBuilderThe to add the services to. /// An action that will configure the . /// The where the services were registered. - public static IRemoteAuthenticationBuilder AddApiAuthorization( + public static IRemoteAuthenticationBuilder AddApiAuthorization<[DynamicallyAccessedMembers(JsonSerialized)] TRemoteAuthenticationState>( this IServiceCollection services, Action> configure) where TRemoteAuthenticationState : RemoteAuthenticationState, new() { @@ -197,7 +203,7 @@ public static IRemoteAuthenticationBuilderThe to add the services to. /// An action that will configure the . /// The where the services were registered. - public static IRemoteAuthenticationBuilder AddApiAuthorization( + public static IRemoteAuthenticationBuilder AddApiAuthorization<[DynamicallyAccessedMembers(JsonSerialized)] TRemoteAuthenticationState, [DynamicallyAccessedMembers(JsonSerialized)] TAccount>( this IServiceCollection services, Action> configure) where TRemoteAuthenticationState : RemoteAuthenticationState, new() where TAccount : RemoteUserAccount @@ -205,7 +211,7 @@ public static IRemoteAuthenticationBuilder(services, configure, Assembly.GetCallingAssembly().GetName().Name); } - private static IRemoteAuthenticationBuilder AddApiAuthorizationCore( + private static IRemoteAuthenticationBuilder AddApiAuthorizationCore<[DynamicallyAccessedMembers(JsonSerialized)] TRemoteAuthenticationState, [DynamicallyAccessedMembers(JsonSerialized)] TAccount>( IServiceCollection services, Action> configure, string inferredClientId) From 384d916e192d5b045f0d286cbc5a61fe24db5d61 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Fri, 28 Jan 2022 10:10:32 -0800 Subject: [PATCH 2/4] Update Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj --- ...pNetCore.Components.WebAssembly.Authentication.csproj | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj b/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj index d605404038b0..ccbffdb22cc4 100644 --- a/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj +++ b/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj @@ -76,7 +76,14 @@ <_InteropBuildOutput Include="$(YarnWorkingDir)dist\$(Configuration)\**" Exclude="$(YarnWorkingDir)dist\.gitignore" /> - + From 1d571d997ae8131232e847834ea170e329a53b34 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Fri, 28 Jan 2022 10:10:56 -0800 Subject: [PATCH 3/4] Apply suggestions from code review Co-authored-by: Tanay Parikh --- .../src/Services/RemoteAuthenticationService.cs | 5 ++++- .../WebAssemblyAuthenticationServiceCollectionExtensions.cs | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Components/WebAssembly/WebAssembly.Authentication/src/Services/RemoteAuthenticationService.cs b/src/Components/WebAssembly/WebAssembly.Authentication/src/Services/RemoteAuthenticationService.cs index ad951b43b6eb..1b3f44b1c8c7 100644 --- a/src/Components/WebAssembly/WebAssembly.Authentication/src/Services/RemoteAuthenticationService.cs +++ b/src/Components/WebAssembly/WebAssembly.Authentication/src/Services/RemoteAuthenticationService.cs @@ -16,7 +16,10 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.Authentication; /// The state to preserve across authentication operations. /// The type of the . /// The options to be passed down to the underlying JavaScript library handling the authentication operations. -public class RemoteAuthenticationService<[DynamicallyAccessedMembers(JsonSerialized)] TRemoteAuthenticationState, [DynamicallyAccessedMembers(JsonSerialized)] TAccount, [DynamicallyAccessedMembers(JsonSerialized)] TProviderOptions> : +public class RemoteAuthenticationService< +[DynamicallyAccessedMembers(JsonSerialized)] TRemoteAuthenticationState, +[DynamicallyAccessedMembers(JsonSerialized)] TAccount, +[DynamicallyAccessedMembers(JsonSerialized)] TProviderOptions> : AuthenticationStateProvider, IRemoteAuthenticationService, IAccessTokenProvider diff --git a/src/Components/WebAssembly/WebAssembly.Authentication/src/WebAssemblyAuthenticationServiceCollectionExtensions.cs b/src/Components/WebAssembly/WebAssembly.Authentication/src/WebAssemblyAuthenticationServiceCollectionExtensions.cs index da8c6c92b2b9..cdadd3ca0157 100644 --- a/src/Components/WebAssembly/WebAssembly.Authentication/src/WebAssemblyAuthenticationServiceCollectionExtensions.cs +++ b/src/Components/WebAssembly/WebAssembly.Authentication/src/WebAssemblyAuthenticationServiceCollectionExtensions.cs @@ -27,7 +27,9 @@ public static class WebAssemblyAuthenticationServiceCollectionExtensions /// The to add the services to. /// The where the services were registered. public static IRemoteAuthenticationBuilder AddRemoteAuthentication< - [DynamicallyAccessedMembers(JsonSerialized)] TRemoteAuthenticationState, [DynamicallyAccessedMembers(JsonSerialized)] TAccount, [DynamicallyAccessedMembers(JsonSerialized)] TProviderOptions>( + [DynamicallyAccessedMembers(JsonSerialized)] TRemoteAuthenticationState, + [DynamicallyAccessedMembers(JsonSerialized)] TAccount, + [DynamicallyAccessedMembers(JsonSerialized)] TProviderOptions>( this IServiceCollection services) where TRemoteAuthenticationState : RemoteAuthenticationState where TAccount : RemoteUserAccount From d226d79f33e45aeb52d1843f06fff51b8a7d538c Mon Sep 17 00:00:00 2001 From: Pranav K Date: Fri, 28 Jan 2022 10:11:07 -0800 Subject: [PATCH 4/4] Update src/Components/WebAssembly/Authentication.Msal/src/MsalWebAssemblyServiceCollectionExtensions.cs Co-authored-by: Tanay Parikh --- .../src/MsalWebAssemblyServiceCollectionExtensions.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Components/WebAssembly/Authentication.Msal/src/MsalWebAssemblyServiceCollectionExtensions.cs b/src/Components/WebAssembly/Authentication.Msal/src/MsalWebAssemblyServiceCollectionExtensions.cs index 4632035b1cf7..65b449be2bec 100644 --- a/src/Components/WebAssembly/Authentication.Msal/src/MsalWebAssemblyServiceCollectionExtensions.cs +++ b/src/Components/WebAssembly/Authentication.Msal/src/MsalWebAssemblyServiceCollectionExtensions.cs @@ -35,7 +35,8 @@ public static IRemoteAuthenticationBuilderThe . /// A callback to configure the . /// The . - public static IRemoteAuthenticationBuilder AddMsalAuthentication<[DynamicallyAccessedMembers(JsonSerialized)] TRemoteAuthenticationState>( + public static IRemoteAuthenticationBuilder AddMsalAuthentication< + [DynamicallyAccessedMembers(JsonSerialized)] TRemoteAuthenticationState>( this IServiceCollection services, Action> configure) where TRemoteAuthenticationState : RemoteAuthenticationState, new() {