From f35564ba0635da588214791b3662085bd30d243e Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Fri, 21 Jun 2019 14:40:42 -0700 Subject: [PATCH] Move DataProtection and Extensions.Identity to netstandard2.0/2.1 (#11008) --- eng/SharedFramework.External.props | 3 + eng/SharedFramework.Local.props | 14 +- ...NetCore.DataProtection.Abstractions.csproj | 6 +- ...Protection.Abstractions.netstandard2.0.cs} | 0 ...NetCore.DataProtection.Abstractions.csproj | 3 +- ...etCore.DataProtection.AzureKeyVault.csproj | 6 +- ...rotection.AzureKeyVault.netstandard2.0.cs} | 0 ...etCore.DataProtection.AzureKeyVault.csproj | 2 +- ...NetCore.DataProtection.AzureStorage.csproj | 6 +- ...Protection.AzureStorage.netstandard2.0.cs} | 0 ...NetCore.DataProtection.AzureStorage.csproj | 2 +- ...ft.AspNetCore.Cryptography.Internal.csproj | 6 +- ...e.Cryptography.Internal.netstandard2.0.cs} | 0 ...ft.AspNetCore.Cryptography.Internal.csproj | 3 +- ...pNetCore.Cryptography.KeyDerivation.csproj | 10 +- ...yptography.KeyDerivation.netcoreapp2.0.cs} | 0 ...yptography.KeyDerivation.netstandard2.0.cs | 16 + ...pNetCore.Cryptography.KeyDerivation.csproj | 3 +- .../src/PBKDF2/NetCorePbkdf2Provider.cs | 2 + .../src/PBKDF2/Pbkdf2Util.cs | 6 + ...Microsoft.AspNetCore.DataProtection.csproj | 8 +- ...pNetCore.DataProtection.netstandard2.0.cs} | 0 ...taProtectionServiceCollectionExtensions.cs | 4 +- ...lter.cs => DataProtectionHostedService.cs} | 23 +- ...Microsoft.AspNetCore.DataProtection.csproj | 6 +- .../DataProtection/test/HostingTests.cs | 32 +- ...oft.AspNetCore.DataProtection.Tests.csproj | 3 +- ....DataProtection.EntityFrameworkCore.csproj | 6 +- ...ion.EntityFrameworkCore.netstandard2.1.cs} | 0 ....DataProtection.EntityFrameworkCore.csproj | 2 +- ...spNetCore.DataProtection.Extensions.csproj | 6 +- ...taProtection.Extensions.netstandard2.0.cs} | 0 ...spNetCore.DataProtection.Extensions.csproj | 3 +- ...e.DataProtection.StackExchangeRedis.csproj | 6 +- ...tion.StackExchangeRedis.netstandard2.0.cs} | 0 ...e.DataProtection.StackExchangeRedis.csproj | 2 +- src/Hosting/Hosting/src/Internal/WebHost.cs | 8 +- src/Hosting/Hosting/test/WebHostTests.cs | 4 +- .../ref/Microsoft.AspNetCore.Identity.csproj | 2 - .../src/Microsoft.AspNetCore.Identity.csproj | 2 - .../Microsoft.Extensions.Identity.Core.csproj | 10 +- ...Extensions.Identity.Core.netstandard2.0.cs | 707 ++++++++++++++++++ .../Microsoft.Extensions.Identity.Core.csproj | 4 +- .../Extensions.Core/src/PasswordHasher.cs | 34 + ...icrosoft.Extensions.Identity.Stores.csproj | 6 +- ...ensions.Identity.Stores.netstandard2.0.cs} | 0 ...icrosoft.Extensions.Identity.Stores.csproj | 4 +- src/Shared/WebEncoders/WebEncoders.cs | 2 + 48 files changed, 896 insertions(+), 76 deletions(-) rename src/DataProtection/Abstractions/ref/{Microsoft.AspNetCore.DataProtection.Abstractions.netcoreapp3.0.cs => Microsoft.AspNetCore.DataProtection.Abstractions.netstandard2.0.cs} (100%) rename src/DataProtection/AzureKeyVault/ref/{Microsoft.AspNetCore.DataProtection.AzureKeyVault.netcoreapp3.0.cs => Microsoft.AspNetCore.DataProtection.AzureKeyVault.netstandard2.0.cs} (100%) rename src/DataProtection/AzureStorage/ref/{Microsoft.AspNetCore.DataProtection.AzureStorage.netcoreapp3.0.cs => Microsoft.AspNetCore.DataProtection.AzureStorage.netstandard2.0.cs} (100%) rename src/DataProtection/Cryptography.Internal/ref/{Microsoft.AspNetCore.Cryptography.Internal.netcoreapp3.0.cs => Microsoft.AspNetCore.Cryptography.Internal.netstandard2.0.cs} (100%) rename src/DataProtection/Cryptography.KeyDerivation/ref/{Microsoft.AspNetCore.Cryptography.KeyDerivation.netcoreapp3.0.cs => Microsoft.AspNetCore.Cryptography.KeyDerivation.netcoreapp2.0.cs} (100%) create mode 100644 src/DataProtection/Cryptography.KeyDerivation/ref/Microsoft.AspNetCore.Cryptography.KeyDerivation.netstandard2.0.cs rename src/DataProtection/DataProtection/ref/{Microsoft.AspNetCore.DataProtection.netcoreapp3.0.cs => Microsoft.AspNetCore.DataProtection.netstandard2.0.cs} (100%) rename src/DataProtection/DataProtection/src/Internal/{DataProtectionStartupFilter.cs => DataProtectionHostedService.cs} (66%) rename src/DataProtection/EntityFrameworkCore/ref/{Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.netcoreapp3.0.cs => Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.netstandard2.1.cs} (100%) rename src/DataProtection/Extensions/ref/{Microsoft.AspNetCore.DataProtection.Extensions.netcoreapp3.0.cs => Microsoft.AspNetCore.DataProtection.Extensions.netstandard2.0.cs} (100%) rename src/DataProtection/StackExchangeRedis/ref/{Microsoft.AspNetCore.DataProtection.StackExchangeRedis.netcoreapp3.0.cs => Microsoft.AspNetCore.DataProtection.StackExchangeRedis.netstandard2.0.cs} (100%) create mode 100644 src/Identity/Extensions.Core/ref/Microsoft.Extensions.Identity.Core.netstandard2.0.cs rename src/Identity/Extensions.Stores/ref/{Microsoft.Extensions.Identity.Stores.netcoreapp3.0.cs => Microsoft.Extensions.Identity.Stores.netstandard2.0.cs} (100%) diff --git a/eng/SharedFramework.External.props b/eng/SharedFramework.External.props index afd88d32a3c7..a6390c8a4d4d 100644 --- a/eng/SharedFramework.External.props +++ b/eng/SharedFramework.External.props @@ -91,6 +91,9 @@ This references are part of Microsoft.NETCore.App, so are listed here as references to be used during compilation only. --> + <_CompilationOnlyReference Include="Microsoft.Win32.Registry" /> + <_CompilationOnlyReference Include="System.Security.Cryptography.Cng" /> + <_CompilationOnlyReference Include="System.Security.Principal.Windows" /> <_CompilationOnlyReference Include="System.Buffers" /> <_CompilationOnlyReference Include="System.ComponentModel.Annotations" /> <_CompilationOnlyReference Include="System.Runtime.CompilerServices.Unsafe" /> diff --git a/eng/SharedFramework.Local.props b/eng/SharedFramework.Local.props index 065172aad2e5..798e1469f270 100644 --- a/eng/SharedFramework.Local.props +++ b/eng/SharedFramework.Local.props @@ -8,8 +8,15 @@ + + + + + + + @@ -20,11 +27,6 @@ - - - - - @@ -40,8 +42,6 @@ - - diff --git a/src/DataProtection/Abstractions/ref/Microsoft.AspNetCore.DataProtection.Abstractions.csproj b/src/DataProtection/Abstractions/ref/Microsoft.AspNetCore.DataProtection.Abstractions.csproj index 914eeb166b0e..62dd2d978a90 100644 --- a/src/DataProtection/Abstractions/ref/Microsoft.AspNetCore.DataProtection.Abstractions.csproj +++ b/src/DataProtection/Abstractions/ref/Microsoft.AspNetCore.DataProtection.Abstractions.csproj @@ -1,10 +1,10 @@ - netcoreapp3.0 + netstandard2.0 - - + + diff --git a/src/DataProtection/Abstractions/ref/Microsoft.AspNetCore.DataProtection.Abstractions.netcoreapp3.0.cs b/src/DataProtection/Abstractions/ref/Microsoft.AspNetCore.DataProtection.Abstractions.netstandard2.0.cs similarity index 100% rename from src/DataProtection/Abstractions/ref/Microsoft.AspNetCore.DataProtection.Abstractions.netcoreapp3.0.cs rename to src/DataProtection/Abstractions/ref/Microsoft.AspNetCore.DataProtection.Abstractions.netstandard2.0.cs diff --git a/src/DataProtection/Abstractions/src/Microsoft.AspNetCore.DataProtection.Abstractions.csproj b/src/DataProtection/Abstractions/src/Microsoft.AspNetCore.DataProtection.Abstractions.csproj index 14606b7db75a..8b7fb04cd759 100644 --- a/src/DataProtection/Abstractions/src/Microsoft.AspNetCore.DataProtection.Abstractions.csproj +++ b/src/DataProtection/Abstractions/src/Microsoft.AspNetCore.DataProtection.Abstractions.csproj @@ -5,8 +5,9 @@ Commonly used types: Microsoft.AspNetCore.DataProtection.IDataProtectionProvider Microsoft.AspNetCore.DataProtection.IDataProtector - netcoreapp3.0 + netstandard2.0 true + true true aspnetcore;dataprotection diff --git a/src/DataProtection/AzureKeyVault/ref/Microsoft.AspNetCore.DataProtection.AzureKeyVault.csproj b/src/DataProtection/AzureKeyVault/ref/Microsoft.AspNetCore.DataProtection.AzureKeyVault.csproj index a13e3ec8cd13..8ed2e9d229e7 100644 --- a/src/DataProtection/AzureKeyVault/ref/Microsoft.AspNetCore.DataProtection.AzureKeyVault.csproj +++ b/src/DataProtection/AzureKeyVault/ref/Microsoft.AspNetCore.DataProtection.AzureKeyVault.csproj @@ -1,10 +1,10 @@ - netcoreapp3.0 + netstandard2.0 - - + + diff --git a/src/DataProtection/AzureKeyVault/ref/Microsoft.AspNetCore.DataProtection.AzureKeyVault.netcoreapp3.0.cs b/src/DataProtection/AzureKeyVault/ref/Microsoft.AspNetCore.DataProtection.AzureKeyVault.netstandard2.0.cs similarity index 100% rename from src/DataProtection/AzureKeyVault/ref/Microsoft.AspNetCore.DataProtection.AzureKeyVault.netcoreapp3.0.cs rename to src/DataProtection/AzureKeyVault/ref/Microsoft.AspNetCore.DataProtection.AzureKeyVault.netstandard2.0.cs diff --git a/src/DataProtection/AzureKeyVault/src/Microsoft.AspNetCore.DataProtection.AzureKeyVault.csproj b/src/DataProtection/AzureKeyVault/src/Microsoft.AspNetCore.DataProtection.AzureKeyVault.csproj index 43dd5ee5840f..2f1aa7c4c0e4 100644 --- a/src/DataProtection/AzureKeyVault/src/Microsoft.AspNetCore.DataProtection.AzureKeyVault.csproj +++ b/src/DataProtection/AzureKeyVault/src/Microsoft.AspNetCore.DataProtection.AzureKeyVault.csproj @@ -2,7 +2,7 @@ Microsoft Azure KeyVault key encryption support. - netcoreapp3.0 + netstandard2.0 true aspnetcore;dataprotection;azure;keyvault true diff --git a/src/DataProtection/AzureStorage/ref/Microsoft.AspNetCore.DataProtection.AzureStorage.csproj b/src/DataProtection/AzureStorage/ref/Microsoft.AspNetCore.DataProtection.AzureStorage.csproj index dc9fa4eb0910..07cb2861f0f3 100644 --- a/src/DataProtection/AzureStorage/ref/Microsoft.AspNetCore.DataProtection.AzureStorage.csproj +++ b/src/DataProtection/AzureStorage/ref/Microsoft.AspNetCore.DataProtection.AzureStorage.csproj @@ -1,10 +1,10 @@ - netcoreapp3.0 + netstandard2.0 - - + + diff --git a/src/DataProtection/AzureStorage/ref/Microsoft.AspNetCore.DataProtection.AzureStorage.netcoreapp3.0.cs b/src/DataProtection/AzureStorage/ref/Microsoft.AspNetCore.DataProtection.AzureStorage.netstandard2.0.cs similarity index 100% rename from src/DataProtection/AzureStorage/ref/Microsoft.AspNetCore.DataProtection.AzureStorage.netcoreapp3.0.cs rename to src/DataProtection/AzureStorage/ref/Microsoft.AspNetCore.DataProtection.AzureStorage.netstandard2.0.cs diff --git a/src/DataProtection/AzureStorage/src/Microsoft.AspNetCore.DataProtection.AzureStorage.csproj b/src/DataProtection/AzureStorage/src/Microsoft.AspNetCore.DataProtection.AzureStorage.csproj index ea12eab5e9b7..8272cd539b5e 100644 --- a/src/DataProtection/AzureStorage/src/Microsoft.AspNetCore.DataProtection.AzureStorage.csproj +++ b/src/DataProtection/AzureStorage/src/Microsoft.AspNetCore.DataProtection.AzureStorage.csproj @@ -2,7 +2,7 @@ Microsoft Azure Blob storage support as key store. - netcoreapp3.0 + netstandard2.0 true true aspnetcore;dataprotection;azure;blob diff --git a/src/DataProtection/Cryptography.Internal/ref/Microsoft.AspNetCore.Cryptography.Internal.csproj b/src/DataProtection/Cryptography.Internal/ref/Microsoft.AspNetCore.Cryptography.Internal.csproj index 8718765fd74a..ec4ae22e0e8f 100644 --- a/src/DataProtection/Cryptography.Internal/ref/Microsoft.AspNetCore.Cryptography.Internal.csproj +++ b/src/DataProtection/Cryptography.Internal/ref/Microsoft.AspNetCore.Cryptography.Internal.csproj @@ -1,10 +1,10 @@ - netcoreapp3.0 + netstandard2.0 - - + + diff --git a/src/DataProtection/Cryptography.Internal/ref/Microsoft.AspNetCore.Cryptography.Internal.netcoreapp3.0.cs b/src/DataProtection/Cryptography.Internal/ref/Microsoft.AspNetCore.Cryptography.Internal.netstandard2.0.cs similarity index 100% rename from src/DataProtection/Cryptography.Internal/ref/Microsoft.AspNetCore.Cryptography.Internal.netcoreapp3.0.cs rename to src/DataProtection/Cryptography.Internal/ref/Microsoft.AspNetCore.Cryptography.Internal.netstandard2.0.cs diff --git a/src/DataProtection/Cryptography.Internal/src/Microsoft.AspNetCore.Cryptography.Internal.csproj b/src/DataProtection/Cryptography.Internal/src/Microsoft.AspNetCore.Cryptography.Internal.csproj index 1ee230c0e117..9fbec5f398e2 100644 --- a/src/DataProtection/Cryptography.Internal/src/Microsoft.AspNetCore.Cryptography.Internal.csproj +++ b/src/DataProtection/Cryptography.Internal/src/Microsoft.AspNetCore.Cryptography.Internal.csproj @@ -2,8 +2,9 @@ Infrastructure for ASP.NET Core cryptographic packages. Applications and libraries should not reference this package directly. - netcoreapp3.0 + netstandard2.0 true + true $(NoWarn);CS1591 true true diff --git a/src/DataProtection/Cryptography.KeyDerivation/ref/Microsoft.AspNetCore.Cryptography.KeyDerivation.csproj b/src/DataProtection/Cryptography.KeyDerivation/ref/Microsoft.AspNetCore.Cryptography.KeyDerivation.csproj index 5f59ea823da8..0dd3dbf34c1c 100644 --- a/src/DataProtection/Cryptography.KeyDerivation/ref/Microsoft.AspNetCore.Cryptography.KeyDerivation.csproj +++ b/src/DataProtection/Cryptography.KeyDerivation/ref/Microsoft.AspNetCore.Cryptography.KeyDerivation.csproj @@ -1,10 +1,14 @@ - netcoreapp3.0 + netstandard2.0;netcoreapp2.0 - - + + + + + + diff --git a/src/DataProtection/Cryptography.KeyDerivation/ref/Microsoft.AspNetCore.Cryptography.KeyDerivation.netcoreapp3.0.cs b/src/DataProtection/Cryptography.KeyDerivation/ref/Microsoft.AspNetCore.Cryptography.KeyDerivation.netcoreapp2.0.cs similarity index 100% rename from src/DataProtection/Cryptography.KeyDerivation/ref/Microsoft.AspNetCore.Cryptography.KeyDerivation.netcoreapp3.0.cs rename to src/DataProtection/Cryptography.KeyDerivation/ref/Microsoft.AspNetCore.Cryptography.KeyDerivation.netcoreapp2.0.cs diff --git a/src/DataProtection/Cryptography.KeyDerivation/ref/Microsoft.AspNetCore.Cryptography.KeyDerivation.netstandard2.0.cs b/src/DataProtection/Cryptography.KeyDerivation/ref/Microsoft.AspNetCore.Cryptography.KeyDerivation.netstandard2.0.cs new file mode 100644 index 000000000000..4ca6f16d11d6 --- /dev/null +++ b/src/DataProtection/Cryptography.KeyDerivation/ref/Microsoft.AspNetCore.Cryptography.KeyDerivation.netstandard2.0.cs @@ -0,0 +1,16 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.AspNetCore.Cryptography.KeyDerivation +{ + public static partial class KeyDerivation + { + public static byte[] Pbkdf2(string password, byte[] salt, Microsoft.AspNetCore.Cryptography.KeyDerivation.KeyDerivationPrf prf, int iterationCount, int numBytesRequested) { throw null; } + } + public enum KeyDerivationPrf + { + HMACSHA1 = 0, + HMACSHA256 = 1, + HMACSHA512 = 2, + } +} diff --git a/src/DataProtection/Cryptography.KeyDerivation/src/Microsoft.AspNetCore.Cryptography.KeyDerivation.csproj b/src/DataProtection/Cryptography.KeyDerivation/src/Microsoft.AspNetCore.Cryptography.KeyDerivation.csproj index 016ac5a57a7d..dea0ee73e28f 100644 --- a/src/DataProtection/Cryptography.KeyDerivation/src/Microsoft.AspNetCore.Cryptography.KeyDerivation.csproj +++ b/src/DataProtection/Cryptography.KeyDerivation/src/Microsoft.AspNetCore.Cryptography.KeyDerivation.csproj @@ -2,8 +2,9 @@ ASP.NET Core utilities for key derivation. - netcoreapp3.0 + netstandard2.0;netcoreapp2.0 true + true true true aspnetcore;dataprotection diff --git a/src/DataProtection/Cryptography.KeyDerivation/src/PBKDF2/NetCorePbkdf2Provider.cs b/src/DataProtection/Cryptography.KeyDerivation/src/PBKDF2/NetCorePbkdf2Provider.cs index ace4fd2be1d0..11b8f481bb82 100644 --- a/src/DataProtection/Cryptography.KeyDerivation/src/PBKDF2/NetCorePbkdf2Provider.cs +++ b/src/DataProtection/Cryptography.KeyDerivation/src/PBKDF2/NetCorePbkdf2Provider.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +#if NETCOREAPP2_0 using System; using System.Diagnostics; using System.Security.Cryptography; @@ -61,3 +62,4 @@ private static byte[] DeriveKeyImpl(string password, byte[] salt, KeyDerivationP } } } +#endif diff --git a/src/DataProtection/Cryptography.KeyDerivation/src/PBKDF2/Pbkdf2Util.cs b/src/DataProtection/Cryptography.KeyDerivation/src/PBKDF2/Pbkdf2Util.cs index 7cbda18bdd53..9b2ecf10089a 100644 --- a/src/DataProtection/Cryptography.KeyDerivation/src/PBKDF2/Pbkdf2Util.cs +++ b/src/DataProtection/Cryptography.KeyDerivation/src/PBKDF2/Pbkdf2Util.cs @@ -27,9 +27,15 @@ private static IPbkdf2Provider GetPbkdf2Provider() } else { +#if NETSTANDARD2_0 + return new ManagedPbkdf2Provider(); +#elif NETCOREAPP2_0 // fastest implementation on .NET Core for Linux/macOS. // Not supported on .NET Framework return new NetCorePbkdf2Provider(); +#else +#error Update target frameworks +#endif } } } diff --git a/src/DataProtection/DataProtection/ref/Microsoft.AspNetCore.DataProtection.csproj b/src/DataProtection/DataProtection/ref/Microsoft.AspNetCore.DataProtection.csproj index adcfda7a042c..f9c576c50102 100644 --- a/src/DataProtection/DataProtection/ref/Microsoft.AspNetCore.DataProtection.csproj +++ b/src/DataProtection/DataProtection/ref/Microsoft.AspNetCore.DataProtection.csproj @@ -1,14 +1,14 @@ - netcoreapp3.0 + netstandard2.0 - - + + - + diff --git a/src/DataProtection/DataProtection/ref/Microsoft.AspNetCore.DataProtection.netcoreapp3.0.cs b/src/DataProtection/DataProtection/ref/Microsoft.AspNetCore.DataProtection.netstandard2.0.cs similarity index 100% rename from src/DataProtection/DataProtection/ref/Microsoft.AspNetCore.DataProtection.netcoreapp3.0.cs rename to src/DataProtection/DataProtection/ref/Microsoft.AspNetCore.DataProtection.netstandard2.0.cs diff --git a/src/DataProtection/DataProtection/src/DataProtectionServiceCollectionExtensions.cs b/src/DataProtection/DataProtection/src/DataProtectionServiceCollectionExtensions.cs index b112e9ac68ef..e6a3d2ceee90 100644 --- a/src/DataProtection/DataProtection/src/DataProtectionServiceCollectionExtensions.cs +++ b/src/DataProtection/DataProtection/src/DataProtectionServiceCollectionExtensions.cs @@ -9,8 +9,8 @@ using Microsoft.AspNetCore.DataProtection.KeyManagement; using Microsoft.AspNetCore.DataProtection.KeyManagement.Internal; using Microsoft.AspNetCore.DataProtection.XmlEncryption; -using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection.Extensions; +using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; @@ -77,7 +77,7 @@ private static void AddDataProtectionServices(IServiceCollection services) services.TryAddSingleton(); services.TryAddSingleton(); - services.TryAddEnumerable(ServiceDescriptor.Singleton()); + services.TryAddEnumerable(ServiceDescriptor.Singleton()); // Internal services services.TryAddSingleton(); diff --git a/src/DataProtection/DataProtection/src/Internal/DataProtectionStartupFilter.cs b/src/DataProtection/DataProtection/src/Internal/DataProtectionHostedService.cs similarity index 66% rename from src/DataProtection/DataProtection/src/Internal/DataProtectionStartupFilter.cs rename to src/DataProtection/DataProtection/src/Internal/DataProtectionHostedService.cs index d9faa5b0f8eb..c31f56e05903 100644 --- a/src/DataProtection/DataProtection/src/Internal/DataProtectionStartupFilter.cs +++ b/src/DataProtection/DataProtection/src/Internal/DataProtectionHostedService.cs @@ -1,31 +1,32 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNetCore.Builder; +using System.Threading; +using System.Threading.Tasks; using Microsoft.AspNetCore.DataProtection.KeyManagement.Internal; -using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; namespace Microsoft.AspNetCore.DataProtection.Internal { - internal class DataProtectionStartupFilter : IStartupFilter + internal class DataProtectionHostedService : IHostedService { private readonly IKeyRingProvider _keyRingProvider; - private readonly ILogger _logger; + private readonly ILogger _logger; - public DataProtectionStartupFilter(IKeyRingProvider keyRingProvider) + public DataProtectionHostedService(IKeyRingProvider keyRingProvider) : this(keyRingProvider, NullLoggerFactory.Instance) { } - public DataProtectionStartupFilter(IKeyRingProvider keyRingProvider, ILoggerFactory loggerFactory) + public DataProtectionHostedService(IKeyRingProvider keyRingProvider, ILoggerFactory loggerFactory) { _keyRingProvider = keyRingProvider; - _logger = loggerFactory.CreateLogger(); + _logger = loggerFactory.CreateLogger(); } - public Action Configure(Action next) + public Task StartAsync(CancellationToken token) { try { @@ -42,7 +43,9 @@ public Action Configure(Action next) _logger.KeyRingFailedToLoadOnStartup(ex); } - return next; + return Task.CompletedTask; } + + public Task StopAsync(CancellationToken token) => Task.CompletedTask; } } diff --git a/src/DataProtection/DataProtection/src/Microsoft.AspNetCore.DataProtection.csproj b/src/DataProtection/DataProtection/src/Microsoft.AspNetCore.DataProtection.csproj index 067f987981df..1c5f507cc273 100644 --- a/src/DataProtection/DataProtection/src/Microsoft.AspNetCore.DataProtection.csproj +++ b/src/DataProtection/DataProtection/src/Microsoft.AspNetCore.DataProtection.csproj @@ -2,8 +2,9 @@ ASP.NET Core logic to protect and unprotect data, similar to DPAPI. - netcoreapp3.0 + netstandard2.0 true + true $(NoWarn);CS1591 true true @@ -17,13 +18,14 @@ - + + diff --git a/src/DataProtection/DataProtection/test/HostingTests.cs b/src/DataProtection/DataProtection/test/HostingTests.cs index cd43effe3768..c687715a4c33 100644 --- a/src/DataProtection/DataProtection/test/HostingTests.cs +++ b/src/DataProtection/DataProtection/test/HostingTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.DataProtection.KeyManagement.Internal; using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Hosting; using Microsoft.AspNetCore.Hosting.Server; using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Testing; @@ -20,7 +21,7 @@ namespace Microsoft.AspNetCore.DataProtection.Test public class HostingTests { [Fact] - public async Task LoadsKeyRingBeforeServerStarts() + public async Task WebhostLoadsKeyRingBeforeServerStarts() { var tcs = new TaskCompletionSource(); var mockKeyRing = new Mock(); @@ -46,6 +47,33 @@ public async Task LoadsKeyRingBeforeServerStarts() mockKeyRing.VerifyAll(); } + [Fact] + public async Task GenericHostLoadsKeyRingBeforeServerStarts() + { + var tcs = new TaskCompletionSource(); + var mockKeyRing = new Mock(); + mockKeyRing.Setup(m => m.GetCurrentKeyRing()) + .Returns(Mock.Of()) + .Callback(() => tcs.TrySetResult(null)); + + var builder = new HostBuilder() + .ConfigureServices(s => + s.AddDataProtection() + .Services + .Replace(ServiceDescriptor.Singleton(mockKeyRing.Object)) + .AddSingleton( + new FakeServer(onStart: () => tcs.TrySetException(new InvalidOperationException("Server was started before key ring was initialized"))))) + .ConfigureWebHost(b => b.UseStartup()); + + using (var host = builder.Build()) + { + await host.StartAsync(); + } + + await tcs.Task.TimeoutAfter(TimeSpan.FromSeconds(10)); + mockKeyRing.VerifyAll(); + } + [Fact] public async Task StartupContinuesOnFailureToLoadKey() { diff --git a/src/DataProtection/DataProtection/test/Microsoft.AspNetCore.DataProtection.Tests.csproj b/src/DataProtection/DataProtection/test/Microsoft.AspNetCore.DataProtection.Tests.csproj index fc84cc88a29f..2e4c664234a0 100644 --- a/src/DataProtection/DataProtection/test/Microsoft.AspNetCore.DataProtection.Tests.csproj +++ b/src/DataProtection/DataProtection/test/Microsoft.AspNetCore.DataProtection.Tests.csproj @@ -1,4 +1,4 @@ - + netcoreapp3.0 @@ -15,6 +15,7 @@ + diff --git a/src/DataProtection/EntityFrameworkCore/ref/Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.csproj b/src/DataProtection/EntityFrameworkCore/ref/Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.csproj index dbc6e58ab8c1..dd34dcfdfd50 100644 --- a/src/DataProtection/EntityFrameworkCore/ref/Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.csproj +++ b/src/DataProtection/EntityFrameworkCore/ref/Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.csproj @@ -1,10 +1,10 @@ - netcoreapp3.0 + netstandard2.1 - - + + diff --git a/src/DataProtection/EntityFrameworkCore/ref/Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.netcoreapp3.0.cs b/src/DataProtection/EntityFrameworkCore/ref/Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.netstandard2.1.cs similarity index 100% rename from src/DataProtection/EntityFrameworkCore/ref/Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.netcoreapp3.0.cs rename to src/DataProtection/EntityFrameworkCore/ref/Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.netstandard2.1.cs diff --git a/src/DataProtection/EntityFrameworkCore/src/Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.csproj b/src/DataProtection/EntityFrameworkCore/src/Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.csproj index 8493504ffb09..58efeab48067 100644 --- a/src/DataProtection/EntityFrameworkCore/src/Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.csproj +++ b/src/DataProtection/EntityFrameworkCore/src/Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.csproj @@ -2,7 +2,7 @@ Support for storing keys using Entity Framework Core. - netcoreapp3.0 + netstandard2.1 true true aspnetcore;dataprotection;entityframeworkcore diff --git a/src/DataProtection/Extensions/ref/Microsoft.AspNetCore.DataProtection.Extensions.csproj b/src/DataProtection/Extensions/ref/Microsoft.AspNetCore.DataProtection.Extensions.csproj index 01a99671f067..82cadaff7a49 100644 --- a/src/DataProtection/Extensions/ref/Microsoft.AspNetCore.DataProtection.Extensions.csproj +++ b/src/DataProtection/Extensions/ref/Microsoft.AspNetCore.DataProtection.Extensions.csproj @@ -1,10 +1,10 @@ - netcoreapp3.0 + netstandard2.0 - - + + diff --git a/src/DataProtection/Extensions/ref/Microsoft.AspNetCore.DataProtection.Extensions.netcoreapp3.0.cs b/src/DataProtection/Extensions/ref/Microsoft.AspNetCore.DataProtection.Extensions.netstandard2.0.cs similarity index 100% rename from src/DataProtection/Extensions/ref/Microsoft.AspNetCore.DataProtection.Extensions.netcoreapp3.0.cs rename to src/DataProtection/Extensions/ref/Microsoft.AspNetCore.DataProtection.Extensions.netstandard2.0.cs diff --git a/src/DataProtection/Extensions/src/Microsoft.AspNetCore.DataProtection.Extensions.csproj b/src/DataProtection/Extensions/src/Microsoft.AspNetCore.DataProtection.Extensions.csproj index fff474980f96..1a0a65d3fa28 100644 --- a/src/DataProtection/Extensions/src/Microsoft.AspNetCore.DataProtection.Extensions.csproj +++ b/src/DataProtection/Extensions/src/Microsoft.AspNetCore.DataProtection.Extensions.csproj @@ -2,8 +2,9 @@ Additional APIs for ASP.NET Core data protection. - netcoreapp3.0 + netstandard2.0 true + true true aspnetcore;dataprotection diff --git a/src/DataProtection/StackExchangeRedis/ref/Microsoft.AspNetCore.DataProtection.StackExchangeRedis.csproj b/src/DataProtection/StackExchangeRedis/ref/Microsoft.AspNetCore.DataProtection.StackExchangeRedis.csproj index 927f13c24d25..013fffddf8c7 100644 --- a/src/DataProtection/StackExchangeRedis/ref/Microsoft.AspNetCore.DataProtection.StackExchangeRedis.csproj +++ b/src/DataProtection/StackExchangeRedis/ref/Microsoft.AspNetCore.DataProtection.StackExchangeRedis.csproj @@ -1,10 +1,10 @@ - netcoreapp3.0 + netstandard2.0 - - + + diff --git a/src/DataProtection/StackExchangeRedis/ref/Microsoft.AspNetCore.DataProtection.StackExchangeRedis.netcoreapp3.0.cs b/src/DataProtection/StackExchangeRedis/ref/Microsoft.AspNetCore.DataProtection.StackExchangeRedis.netstandard2.0.cs similarity index 100% rename from src/DataProtection/StackExchangeRedis/ref/Microsoft.AspNetCore.DataProtection.StackExchangeRedis.netcoreapp3.0.cs rename to src/DataProtection/StackExchangeRedis/ref/Microsoft.AspNetCore.DataProtection.StackExchangeRedis.netstandard2.0.cs diff --git a/src/DataProtection/StackExchangeRedis/src/Microsoft.AspNetCore.DataProtection.StackExchangeRedis.csproj b/src/DataProtection/StackExchangeRedis/src/Microsoft.AspNetCore.DataProtection.StackExchangeRedis.csproj index af2d8cbe7e9f..ed592f5831d2 100644 --- a/src/DataProtection/StackExchangeRedis/src/Microsoft.AspNetCore.DataProtection.StackExchangeRedis.csproj +++ b/src/DataProtection/StackExchangeRedis/src/Microsoft.AspNetCore.DataProtection.StackExchangeRedis.csproj @@ -2,7 +2,7 @@ Support for storing data protection keys in Redis. - netcoreapp3.0 + netstandard2.0 true true aspnetcore;dataprotection;redis diff --git a/src/Hosting/Hosting/src/Internal/WebHost.cs b/src/Hosting/Hosting/src/Internal/WebHost.cs index ec6d3d84a09d..57b974a80002 100644 --- a/src/Hosting/Hosting/src/Internal/WebHost.cs +++ b/src/Hosting/Hosting/src/Internal/WebHost.cs @@ -149,6 +149,10 @@ public virtual async Task StartAsync(CancellationToken cancellationToken = defau _applicationLifetime = _applicationServices.GetRequiredService(); _hostedServiceExecutor = _applicationServices.GetRequiredService(); + + // Fire IHostedService.Start + await _hostedServiceExecutor.StartAsync(cancellationToken).ConfigureAwait(false); + var diagnosticSource = _applicationServices.GetRequiredService(); var httpContextFactory = _applicationServices.GetRequiredService(); var hostingApp = new HostingApplication(application, _logger, diagnosticSource, httpContextFactory); @@ -158,8 +162,6 @@ public virtual async Task StartAsync(CancellationToken cancellationToken = defau // Fire IApplicationLifetime.Started _applicationLifetime?.NotifyStarted(); - // Fire IHostedService.Start - await _hostedServiceExecutor.StartAsync(cancellationToken).ConfigureAwait(false); _logger.Started(); @@ -339,7 +341,7 @@ public async Task StopAsync(CancellationToken cancellationToken = default) } // Fire the IHostedService.Stop - if (_hostedServiceExecutor != null && _startedServer) + if (_hostedServiceExecutor != null) { await _hostedServiceExecutor.StopAsync(cancellationToken).ConfigureAwait(false); } diff --git a/src/Hosting/Hosting/test/WebHostTests.cs b/src/Hosting/Hosting/test/WebHostTests.cs index 3d4a67b0769e..cdc53386daa3 100644 --- a/src/Hosting/Hosting/test/WebHostTests.cs +++ b/src/Hosting/Hosting/test/WebHostTests.cs @@ -702,8 +702,8 @@ public async Task WebHostDoesNotNotifyAllIHostedServicesAndIApplicationLifetimeC await Assert.ThrowsAsync(() => host.StartAsync()); Assert.True(hostedServiceCalls1[0]); Assert.False(hostedServiceCalls2[0]); - Assert.True(started.All(s => s)); - Assert.True(started2.All(s => s)); + Assert.False(started.All(s => s)); // Server doesn't start if hosted services throw + Assert.False(started2.All(s => s)); host.Dispose(); Assert.True(hostedServiceCalls1[1]); Assert.True(hostedServiceCalls2[1]); diff --git a/src/Identity/Core/ref/Microsoft.AspNetCore.Identity.csproj b/src/Identity/Core/ref/Microsoft.AspNetCore.Identity.csproj index 55b8c20bcca9..29f919fbe6ba 100644 --- a/src/Identity/Core/ref/Microsoft.AspNetCore.Identity.csproj +++ b/src/Identity/Core/ref/Microsoft.AspNetCore.Identity.csproj @@ -6,8 +6,6 @@ - - diff --git a/src/Identity/Core/src/Microsoft.AspNetCore.Identity.csproj b/src/Identity/Core/src/Microsoft.AspNetCore.Identity.csproj index 6006e4fa1ed0..1804604b76be 100644 --- a/src/Identity/Core/src/Microsoft.AspNetCore.Identity.csproj +++ b/src/Identity/Core/src/Microsoft.AspNetCore.Identity.csproj @@ -10,8 +10,6 @@ - - diff --git a/src/Identity/Extensions.Core/ref/Microsoft.Extensions.Identity.Core.csproj b/src/Identity/Extensions.Core/ref/Microsoft.Extensions.Identity.Core.csproj index 1fd47b56f5eb..50615ee4e140 100644 --- a/src/Identity/Extensions.Core/ref/Microsoft.Extensions.Identity.Core.csproj +++ b/src/Identity/Extensions.Core/ref/Microsoft.Extensions.Identity.Core.csproj @@ -1,9 +1,15 @@ - netcoreapp3.0 + netstandard2.0;netcoreapp3.0 - + + + + + + + diff --git a/src/Identity/Extensions.Core/ref/Microsoft.Extensions.Identity.Core.netstandard2.0.cs b/src/Identity/Extensions.Core/ref/Microsoft.Extensions.Identity.Core.netstandard2.0.cs new file mode 100644 index 000000000000..f934eb8db2b7 --- /dev/null +++ b/src/Identity/Extensions.Core/ref/Microsoft.Extensions.Identity.Core.netstandard2.0.cs @@ -0,0 +1,707 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.AspNetCore.Identity +{ + public partial class AuthenticatorTokenProvider : Microsoft.AspNetCore.Identity.IUserTwoFactorTokenProvider where TUser : class + { + public AuthenticatorTokenProvider() { } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task CanGenerateTwoFactorTokenAsync(Microsoft.AspNetCore.Identity.UserManager manager, TUser user) { throw null; } + public virtual System.Threading.Tasks.Task GenerateAsync(string purpose, Microsoft.AspNetCore.Identity.UserManager manager, TUser user) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task ValidateAsync(string purpose, string token, Microsoft.AspNetCore.Identity.UserManager manager, TUser user) { throw null; } + } + public partial class ClaimsIdentityOptions + { + public ClaimsIdentityOptions() { } + public string RoleClaimType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public string SecurityStampClaimType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public string UserIdClaimType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public string UserNameClaimType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + } + public partial class DefaultPersonalDataProtector : Microsoft.AspNetCore.Identity.IPersonalDataProtector + { + public DefaultPersonalDataProtector(Microsoft.AspNetCore.Identity.ILookupProtectorKeyRing keyRing, Microsoft.AspNetCore.Identity.ILookupProtector protector) { } + public virtual string Protect(string data) { throw null; } + public virtual string Unprotect(string data) { throw null; } + } + public partial class DefaultUserConfirmation : Microsoft.AspNetCore.Identity.IUserConfirmation where TUser : class + { + public DefaultUserConfirmation() { } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task IsConfirmedAsync(Microsoft.AspNetCore.Identity.UserManager manager, TUser user) { throw null; } + } + public partial class EmailTokenProvider : Microsoft.AspNetCore.Identity.TotpSecurityStampBasedTokenProvider where TUser : class + { + public EmailTokenProvider() { } + [System.Diagnostics.DebuggerStepThroughAttribute] + public override System.Threading.Tasks.Task CanGenerateTwoFactorTokenAsync(Microsoft.AspNetCore.Identity.UserManager manager, TUser user) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public override System.Threading.Tasks.Task GetUserModifierAsync(string purpose, Microsoft.AspNetCore.Identity.UserManager manager, TUser user) { throw null; } + } + public partial class IdentityBuilder + { + public IdentityBuilder(System.Type user, Microsoft.Extensions.DependencyInjection.IServiceCollection services) { } + public IdentityBuilder(System.Type user, System.Type role, Microsoft.Extensions.DependencyInjection.IServiceCollection services) { } + public System.Type RoleType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.Extensions.DependencyInjection.IServiceCollection Services { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public System.Type UserType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public virtual Microsoft.AspNetCore.Identity.IdentityBuilder AddClaimsPrincipalFactory() where TFactory : class { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityBuilder AddErrorDescriber() where TDescriber : Microsoft.AspNetCore.Identity.IdentityErrorDescriber { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityBuilder AddPasswordValidator() where TValidator : class { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityBuilder AddPersonalDataProtection() where TProtector : class, Microsoft.AspNetCore.Identity.ILookupProtector where TKeyRing : class, Microsoft.AspNetCore.Identity.ILookupProtectorKeyRing { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityBuilder AddRoleManager() where TRoleManager : class { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityBuilder AddRoleStore() where TStore : class { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityBuilder AddRoles() where TRole : class { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityBuilder AddRoleValidator() where TRole : class { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityBuilder AddTokenProvider(string providerName, System.Type provider) { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityBuilder AddTokenProvider(string providerName) where TProvider : class { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityBuilder AddUserManager() where TUserManager : class { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityBuilder AddUserStore() where TStore : class { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityBuilder AddUserValidator() where TValidator : class { throw null; } + } + public partial class IdentityError + { + public IdentityError() { } + public string Code { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public string Description { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + } + public partial class IdentityErrorDescriber + { + public IdentityErrorDescriber() { } + public virtual Microsoft.AspNetCore.Identity.IdentityError ConcurrencyFailure() { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityError DefaultError() { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityError DuplicateEmail(string email) { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityError DuplicateRoleName(string role) { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityError DuplicateUserName(string userName) { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityError InvalidEmail(string email) { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityError InvalidRoleName(string role) { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityError InvalidToken() { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityError InvalidUserName(string userName) { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityError LoginAlreadyAssociated() { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityError PasswordMismatch() { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityError PasswordRequiresDigit() { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityError PasswordRequiresLower() { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityError PasswordRequiresNonAlphanumeric() { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityError PasswordRequiresUniqueChars(int uniqueChars) { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityError PasswordRequiresUpper() { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityError PasswordTooShort(int length) { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityError RecoveryCodeRedemptionFailed() { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityError UserAlreadyHasPassword() { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityError UserAlreadyInRole(string role) { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityError UserLockoutNotEnabled() { throw null; } + public virtual Microsoft.AspNetCore.Identity.IdentityError UserNotInRole(string role) { throw null; } + } + public partial class IdentityOptions + { + public IdentityOptions() { } + public Microsoft.AspNetCore.Identity.ClaimsIdentityOptions ClaimsIdentity { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public Microsoft.AspNetCore.Identity.LockoutOptions Lockout { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public Microsoft.AspNetCore.Identity.PasswordOptions Password { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public Microsoft.AspNetCore.Identity.SignInOptions SignIn { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public Microsoft.AspNetCore.Identity.StoreOptions Stores { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public Microsoft.AspNetCore.Identity.TokenOptions Tokens { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public Microsoft.AspNetCore.Identity.UserOptions User { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + } + public partial class IdentityResult + { + public IdentityResult() { } + public System.Collections.Generic.IEnumerable Errors { get { throw null; } } + public bool Succeeded { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]protected set { } } + public static Microsoft.AspNetCore.Identity.IdentityResult Success { get { throw null; } } + public static Microsoft.AspNetCore.Identity.IdentityResult Failed(params Microsoft.AspNetCore.Identity.IdentityError[] errors) { throw null; } + public override string ToString() { throw null; } + } + public partial interface ILookupNormalizer + { + string NormalizeEmail(string email); + string NormalizeName(string name); + } + public partial interface ILookupProtector + { + string Protect(string keyId, string data); + string Unprotect(string keyId, string data); + } + public partial interface ILookupProtectorKeyRing + { + string CurrentKeyId { get; } + string this[string keyId] { get; } + System.Collections.Generic.IEnumerable GetAllKeyIds(); + } + public partial interface IPasswordHasher where TUser : class + { + string HashPassword(TUser user, string password); + Microsoft.AspNetCore.Identity.PasswordVerificationResult VerifyHashedPassword(TUser user, string hashedPassword, string providedPassword); + } + public partial interface IPasswordValidator where TUser : class + { + System.Threading.Tasks.Task ValidateAsync(Microsoft.AspNetCore.Identity.UserManager manager, TUser user, string password); + } + public partial interface IPersonalDataProtector + { + string Protect(string data); + string Unprotect(string data); + } + public partial interface IProtectedUserStore : Microsoft.AspNetCore.Identity.IUserStore, System.IDisposable where TUser : class + { + } + public partial interface IQueryableRoleStore : Microsoft.AspNetCore.Identity.IRoleStore, System.IDisposable where TRole : class + { + System.Linq.IQueryable Roles { get; } + } + public partial interface IQueryableUserStore : Microsoft.AspNetCore.Identity.IUserStore, System.IDisposable where TUser : class + { + System.Linq.IQueryable Users { get; } + } + public partial interface IRoleClaimStore : Microsoft.AspNetCore.Identity.IRoleStore, System.IDisposable where TRole : class + { + System.Threading.Tasks.Task AddClaimAsync(TRole role, System.Security.Claims.Claim claim, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetClaimsAsync(TRole role, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task RemoveClaimAsync(TRole role, System.Security.Claims.Claim claim, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } + public partial interface IRoleStore : System.IDisposable where TRole : class + { + System.Threading.Tasks.Task CreateAsync(TRole role, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task DeleteAsync(TRole role, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task FindByIdAsync(string roleId, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task FindByNameAsync(string normalizedRoleName, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task GetNormalizedRoleNameAsync(TRole role, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task GetRoleIdAsync(TRole role, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task GetRoleNameAsync(TRole role, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task SetNormalizedRoleNameAsync(TRole role, string normalizedName, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task SetRoleNameAsync(TRole role, string roleName, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task UpdateAsync(TRole role, System.Threading.CancellationToken cancellationToken); + } + public partial interface IRoleValidator where TRole : class + { + System.Threading.Tasks.Task ValidateAsync(Microsoft.AspNetCore.Identity.RoleManager manager, TRole role); + } + public partial interface IUserAuthenticationTokenStore : Microsoft.AspNetCore.Identity.IUserStore, System.IDisposable where TUser : class + { + System.Threading.Tasks.Task GetTokenAsync(TUser user, string loginProvider, string name, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task RemoveTokenAsync(TUser user, string loginProvider, string name, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task SetTokenAsync(TUser user, string loginProvider, string name, string value, System.Threading.CancellationToken cancellationToken); + } + public partial interface IUserAuthenticatorKeyStore : Microsoft.AspNetCore.Identity.IUserStore, System.IDisposable where TUser : class + { + System.Threading.Tasks.Task GetAuthenticatorKeyAsync(TUser user, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task SetAuthenticatorKeyAsync(TUser user, string key, System.Threading.CancellationToken cancellationToken); + } + public partial interface IUserClaimsPrincipalFactory where TUser : class + { + System.Threading.Tasks.Task CreateAsync(TUser user); + } + public partial interface IUserClaimStore : Microsoft.AspNetCore.Identity.IUserStore, System.IDisposable where TUser : class + { + System.Threading.Tasks.Task AddClaimsAsync(TUser user, System.Collections.Generic.IEnumerable claims, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task> GetClaimsAsync(TUser user, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task> GetUsersForClaimAsync(System.Security.Claims.Claim claim, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task RemoveClaimsAsync(TUser user, System.Collections.Generic.IEnumerable claims, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task ReplaceClaimAsync(TUser user, System.Security.Claims.Claim claim, System.Security.Claims.Claim newClaim, System.Threading.CancellationToken cancellationToken); + } + public partial interface IUserConfirmation where TUser : class + { + System.Threading.Tasks.Task IsConfirmedAsync(Microsoft.AspNetCore.Identity.UserManager manager, TUser user); + } + public partial interface IUserEmailStore : Microsoft.AspNetCore.Identity.IUserStore, System.IDisposable where TUser : class + { + System.Threading.Tasks.Task FindByEmailAsync(string normalizedEmail, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task GetEmailAsync(TUser user, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task GetEmailConfirmedAsync(TUser user, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task GetNormalizedEmailAsync(TUser user, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task SetEmailAsync(TUser user, string email, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task SetEmailConfirmedAsync(TUser user, bool confirmed, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task SetNormalizedEmailAsync(TUser user, string normalizedEmail, System.Threading.CancellationToken cancellationToken); + } + public partial interface IUserLockoutStore : Microsoft.AspNetCore.Identity.IUserStore, System.IDisposable where TUser : class + { + System.Threading.Tasks.Task GetAccessFailedCountAsync(TUser user, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task GetLockoutEnabledAsync(TUser user, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task GetLockoutEndDateAsync(TUser user, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task IncrementAccessFailedCountAsync(TUser user, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task ResetAccessFailedCountAsync(TUser user, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task SetLockoutEnabledAsync(TUser user, bool enabled, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task SetLockoutEndDateAsync(TUser user, System.DateTimeOffset? lockoutEnd, System.Threading.CancellationToken cancellationToken); + } + public partial interface IUserLoginStore : Microsoft.AspNetCore.Identity.IUserStore, System.IDisposable where TUser : class + { + System.Threading.Tasks.Task AddLoginAsync(TUser user, Microsoft.AspNetCore.Identity.UserLoginInfo login, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task FindByLoginAsync(string loginProvider, string providerKey, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task> GetLoginsAsync(TUser user, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task RemoveLoginAsync(TUser user, string loginProvider, string providerKey, System.Threading.CancellationToken cancellationToken); + } + public partial interface IUserPasswordStore : Microsoft.AspNetCore.Identity.IUserStore, System.IDisposable where TUser : class + { + System.Threading.Tasks.Task GetPasswordHashAsync(TUser user, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task HasPasswordAsync(TUser user, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task SetPasswordHashAsync(TUser user, string passwordHash, System.Threading.CancellationToken cancellationToken); + } + public partial interface IUserPhoneNumberStore : Microsoft.AspNetCore.Identity.IUserStore, System.IDisposable where TUser : class + { + System.Threading.Tasks.Task GetPhoneNumberAsync(TUser user, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task GetPhoneNumberConfirmedAsync(TUser user, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task SetPhoneNumberAsync(TUser user, string phoneNumber, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task SetPhoneNumberConfirmedAsync(TUser user, bool confirmed, System.Threading.CancellationToken cancellationToken); + } + public partial interface IUserRoleStore : Microsoft.AspNetCore.Identity.IUserStore, System.IDisposable where TUser : class + { + System.Threading.Tasks.Task AddToRoleAsync(TUser user, string roleName, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task> GetRolesAsync(TUser user, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task> GetUsersInRoleAsync(string roleName, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task IsInRoleAsync(TUser user, string roleName, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task RemoveFromRoleAsync(TUser user, string roleName, System.Threading.CancellationToken cancellationToken); + } + public partial interface IUserSecurityStampStore : Microsoft.AspNetCore.Identity.IUserStore, System.IDisposable where TUser : class + { + System.Threading.Tasks.Task GetSecurityStampAsync(TUser user, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task SetSecurityStampAsync(TUser user, string stamp, System.Threading.CancellationToken cancellationToken); + } + public partial interface IUserStore : System.IDisposable where TUser : class + { + System.Threading.Tasks.Task CreateAsync(TUser user, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task DeleteAsync(TUser user, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task FindByIdAsync(string userId, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task FindByNameAsync(string normalizedUserName, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task GetNormalizedUserNameAsync(TUser user, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task GetUserIdAsync(TUser user, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task GetUserNameAsync(TUser user, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task SetNormalizedUserNameAsync(TUser user, string normalizedName, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task SetUserNameAsync(TUser user, string userName, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task UpdateAsync(TUser user, System.Threading.CancellationToken cancellationToken); + } + public partial interface IUserTwoFactorRecoveryCodeStore : Microsoft.AspNetCore.Identity.IUserStore, System.IDisposable where TUser : class + { + System.Threading.Tasks.Task CountCodesAsync(TUser user, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task RedeemCodeAsync(TUser user, string code, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task ReplaceCodesAsync(TUser user, System.Collections.Generic.IEnumerable recoveryCodes, System.Threading.CancellationToken cancellationToken); + } + public partial interface IUserTwoFactorStore : Microsoft.AspNetCore.Identity.IUserStore, System.IDisposable where TUser : class + { + System.Threading.Tasks.Task GetTwoFactorEnabledAsync(TUser user, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task SetTwoFactorEnabledAsync(TUser user, bool enabled, System.Threading.CancellationToken cancellationToken); + } + public partial interface IUserTwoFactorTokenProvider where TUser : class + { + System.Threading.Tasks.Task CanGenerateTwoFactorTokenAsync(Microsoft.AspNetCore.Identity.UserManager manager, TUser user); + System.Threading.Tasks.Task GenerateAsync(string purpose, Microsoft.AspNetCore.Identity.UserManager manager, TUser user); + System.Threading.Tasks.Task ValidateAsync(string purpose, string token, Microsoft.AspNetCore.Identity.UserManager manager, TUser user); + } + public partial interface IUserValidator where TUser : class + { + System.Threading.Tasks.Task ValidateAsync(Microsoft.AspNetCore.Identity.UserManager manager, TUser user); + } + public partial class LockoutOptions + { + public LockoutOptions() { } + public bool AllowedForNewUsers { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public System.TimeSpan DefaultLockoutTimeSpan { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public int MaxFailedAccessAttempts { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + } + public enum PasswordHasherCompatibilityMode + { + IdentityV2 = 0, + IdentityV3 = 1, + } + public partial class PasswordHasherOptions + { + public PasswordHasherOptions() { } + public Microsoft.AspNetCore.Identity.PasswordHasherCompatibilityMode CompatibilityMode { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public int IterationCount { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + } + public partial class PasswordHasher : Microsoft.AspNetCore.Identity.IPasswordHasher where TUser : class + { + public PasswordHasher(Microsoft.Extensions.Options.IOptions optionsAccessor = null) { } + public virtual string HashPassword(TUser user, string password) { throw null; } + public virtual Microsoft.AspNetCore.Identity.PasswordVerificationResult VerifyHashedPassword(TUser user, string hashedPassword, string providedPassword) { throw null; } + } + public partial class PasswordOptions + { + public PasswordOptions() { } + public bool RequireDigit { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public int RequiredLength { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public int RequiredUniqueChars { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public bool RequireLowercase { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public bool RequireNonAlphanumeric { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public bool RequireUppercase { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + } + public partial class PasswordValidator : Microsoft.AspNetCore.Identity.IPasswordValidator where TUser : class + { + public PasswordValidator(Microsoft.AspNetCore.Identity.IdentityErrorDescriber errors = null) { } + public Microsoft.AspNetCore.Identity.IdentityErrorDescriber Describer { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public virtual bool IsDigit(char c) { throw null; } + public virtual bool IsLetterOrDigit(char c) { throw null; } + public virtual bool IsLower(char c) { throw null; } + public virtual bool IsUpper(char c) { throw null; } + public virtual System.Threading.Tasks.Task ValidateAsync(Microsoft.AspNetCore.Identity.UserManager manager, TUser user, string password) { throw null; } + } + public enum PasswordVerificationResult + { + Failed = 0, + Success = 1, + SuccessRehashNeeded = 2, + } + public partial class PersonalDataAttribute : System.Attribute + { + public PersonalDataAttribute() { } + } + public partial class PhoneNumberTokenProvider : Microsoft.AspNetCore.Identity.TotpSecurityStampBasedTokenProvider where TUser : class + { + public PhoneNumberTokenProvider() { } + [System.Diagnostics.DebuggerStepThroughAttribute] + public override System.Threading.Tasks.Task CanGenerateTwoFactorTokenAsync(Microsoft.AspNetCore.Identity.UserManager manager, TUser user) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public override System.Threading.Tasks.Task GetUserModifierAsync(string purpose, Microsoft.AspNetCore.Identity.UserManager manager, TUser user) { throw null; } + } + public partial class ProtectedPersonalDataAttribute : Microsoft.AspNetCore.Identity.PersonalDataAttribute + { + public ProtectedPersonalDataAttribute() { } + } + public partial class RoleManager : System.IDisposable where TRole : class + { + public RoleManager(Microsoft.AspNetCore.Identity.IRoleStore store, System.Collections.Generic.IEnumerable> roleValidators, Microsoft.AspNetCore.Identity.ILookupNormalizer keyNormalizer, Microsoft.AspNetCore.Identity.IdentityErrorDescriber errors, Microsoft.Extensions.Logging.ILogger> logger) { } + protected virtual System.Threading.CancellationToken CancellationToken { get { throw null; } } + public Microsoft.AspNetCore.Identity.IdentityErrorDescriber ErrorDescriber { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public Microsoft.AspNetCore.Identity.ILookupNormalizer KeyNormalizer { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public virtual Microsoft.Extensions.Logging.ILogger Logger { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public virtual System.Linq.IQueryable Roles { get { throw null; } } + public System.Collections.Generic.IList> RoleValidators { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected Microsoft.AspNetCore.Identity.IRoleStore Store { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public virtual bool SupportsQueryableRoles { get { throw null; } } + public virtual bool SupportsRoleClaims { get { throw null; } } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task AddClaimAsync(TRole role, System.Security.Claims.Claim claim) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task CreateAsync(TRole role) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(TRole role) { throw null; } + public void Dispose() { } + protected virtual void Dispose(bool disposing) { } + public virtual System.Threading.Tasks.Task FindByIdAsync(string roleId) { throw null; } + public virtual System.Threading.Tasks.Task FindByNameAsync(string roleName) { throw null; } + public virtual System.Threading.Tasks.Task> GetClaimsAsync(TRole role) { throw null; } + public virtual System.Threading.Tasks.Task GetRoleIdAsync(TRole role) { throw null; } + public virtual System.Threading.Tasks.Task GetRoleNameAsync(TRole role) { throw null; } + public virtual string NormalizeKey(string key) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task RemoveClaimAsync(TRole role, System.Security.Claims.Claim claim) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task RoleExistsAsync(string roleName) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task SetRoleNameAsync(TRole role, string name) { throw null; } + protected void ThrowIfDisposed() { } + public virtual System.Threading.Tasks.Task UpdateAsync(TRole role) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task UpdateNormalizedRoleNameAsync(TRole role) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + protected virtual System.Threading.Tasks.Task UpdateRoleAsync(TRole role) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + protected virtual System.Threading.Tasks.Task ValidateRoleAsync(TRole role) { throw null; } + } + public partial class RoleValidator : Microsoft.AspNetCore.Identity.IRoleValidator where TRole : class + { + public RoleValidator(Microsoft.AspNetCore.Identity.IdentityErrorDescriber errors = null) { } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task ValidateAsync(Microsoft.AspNetCore.Identity.RoleManager manager, TRole role) { throw null; } + } + public partial class SignInOptions + { + public SignInOptions() { } + public bool RequireConfirmedAccount { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public bool RequireConfirmedEmail { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public bool RequireConfirmedPhoneNumber { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + } + public partial class SignInResult + { + public SignInResult() { } + public static Microsoft.AspNetCore.Identity.SignInResult Failed { get { throw null; } } + public bool IsLockedOut { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]protected set { } } + public bool IsNotAllowed { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]protected set { } } + public static Microsoft.AspNetCore.Identity.SignInResult LockedOut { get { throw null; } } + public static Microsoft.AspNetCore.Identity.SignInResult NotAllowed { get { throw null; } } + public bool RequiresTwoFactor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]protected set { } } + public bool Succeeded { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]protected set { } } + public static Microsoft.AspNetCore.Identity.SignInResult Success { get { throw null; } } + public static Microsoft.AspNetCore.Identity.SignInResult TwoFactorRequired { get { throw null; } } + public override string ToString() { throw null; } + } + public partial class StoreOptions + { + public StoreOptions() { } + public int MaxLengthForKeys { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public bool ProtectPersonalData { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + } + public partial class TokenOptions + { + public static readonly string DefaultAuthenticatorProvider; + public static readonly string DefaultEmailProvider; + public static readonly string DefaultPhoneProvider; + public static readonly string DefaultProvider; + public TokenOptions() { } + public string AuthenticatorIssuer { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public string AuthenticatorTokenProvider { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public string ChangeEmailTokenProvider { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public string ChangePhoneNumberTokenProvider { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public string EmailConfirmationTokenProvider { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public string PasswordResetTokenProvider { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public System.Collections.Generic.Dictionary ProviderMap { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + } + public partial class TokenProviderDescriptor + { + public TokenProviderDescriptor(System.Type type) { } + public object ProviderInstance { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public System.Type ProviderType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public abstract partial class TotpSecurityStampBasedTokenProvider : Microsoft.AspNetCore.Identity.IUserTwoFactorTokenProvider where TUser : class + { + protected TotpSecurityStampBasedTokenProvider() { } + public abstract System.Threading.Tasks.Task CanGenerateTwoFactorTokenAsync(Microsoft.AspNetCore.Identity.UserManager manager, TUser user); + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task GenerateAsync(string purpose, Microsoft.AspNetCore.Identity.UserManager manager, TUser user) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task GetUserModifierAsync(string purpose, Microsoft.AspNetCore.Identity.UserManager manager, TUser user) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task ValidateAsync(string purpose, string token, Microsoft.AspNetCore.Identity.UserManager manager, TUser user) { throw null; } + } + public sealed partial class UpperInvariantLookupNormalizer : Microsoft.AspNetCore.Identity.ILookupNormalizer + { + public UpperInvariantLookupNormalizer() { } + public string NormalizeEmail(string email) { throw null; } + public string NormalizeName(string name) { throw null; } + } + public partial class UserClaimsPrincipalFactory : Microsoft.AspNetCore.Identity.IUserClaimsPrincipalFactory where TUser : class + { + public UserClaimsPrincipalFactory(Microsoft.AspNetCore.Identity.UserManager userManager, Microsoft.Extensions.Options.IOptions optionsAccessor) { } + public Microsoft.AspNetCore.Identity.IdentityOptions Options { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Identity.UserManager UserManager { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task CreateAsync(TUser user) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + protected virtual System.Threading.Tasks.Task GenerateClaimsAsync(TUser user) { throw null; } + } + public partial class UserClaimsPrincipalFactory : Microsoft.AspNetCore.Identity.UserClaimsPrincipalFactory where TUser : class where TRole : class + { + public UserClaimsPrincipalFactory(Microsoft.AspNetCore.Identity.UserManager userManager, Microsoft.AspNetCore.Identity.RoleManager roleManager, Microsoft.Extensions.Options.IOptions options) : base (default(Microsoft.AspNetCore.Identity.UserManager), default(Microsoft.Extensions.Options.IOptions)) { } + public Microsoft.AspNetCore.Identity.RoleManager RoleManager { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + [System.Diagnostics.DebuggerStepThroughAttribute] + protected override System.Threading.Tasks.Task GenerateClaimsAsync(TUser user) { throw null; } + } + public partial class UserLoginInfo + { + public UserLoginInfo(string loginProvider, string providerKey, string displayName) { } + public string LoginProvider { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public string ProviderDisplayName { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public string ProviderKey { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + } + public partial class UserManager : System.IDisposable where TUser : class + { + public const string ChangePhoneNumberTokenPurpose = "ChangePhoneNumber"; + public const string ConfirmEmailTokenPurpose = "EmailConfirmation"; + public const string ResetPasswordTokenPurpose = "ResetPassword"; + public UserManager(Microsoft.AspNetCore.Identity.IUserStore store, Microsoft.Extensions.Options.IOptions optionsAccessor, Microsoft.AspNetCore.Identity.IPasswordHasher passwordHasher, System.Collections.Generic.IEnumerable> userValidators, System.Collections.Generic.IEnumerable> passwordValidators, Microsoft.AspNetCore.Identity.ILookupNormalizer keyNormalizer, Microsoft.AspNetCore.Identity.IdentityErrorDescriber errors, System.IServiceProvider services, Microsoft.Extensions.Logging.ILogger> logger) { } + protected virtual System.Threading.CancellationToken CancellationToken { get { throw null; } } + public Microsoft.AspNetCore.Identity.IdentityErrorDescriber ErrorDescriber { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public Microsoft.AspNetCore.Identity.ILookupNormalizer KeyNormalizer { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public virtual Microsoft.Extensions.Logging.ILogger Logger { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public Microsoft.AspNetCore.Identity.IdentityOptions Options { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public Microsoft.AspNetCore.Identity.IPasswordHasher PasswordHasher { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public System.Collections.Generic.IList> PasswordValidators { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected internal Microsoft.AspNetCore.Identity.IUserStore Store { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public virtual bool SupportsQueryableUsers { get { throw null; } } + public virtual bool SupportsUserAuthenticationTokens { get { throw null; } } + public virtual bool SupportsUserAuthenticatorKey { get { throw null; } } + public virtual bool SupportsUserClaim { get { throw null; } } + public virtual bool SupportsUserEmail { get { throw null; } } + public virtual bool SupportsUserLockout { get { throw null; } } + public virtual bool SupportsUserLogin { get { throw null; } } + public virtual bool SupportsUserPassword { get { throw null; } } + public virtual bool SupportsUserPhoneNumber { get { throw null; } } + public virtual bool SupportsUserRole { get { throw null; } } + public virtual bool SupportsUserSecurityStamp { get { throw null; } } + public virtual bool SupportsUserTwoFactor { get { throw null; } } + public virtual bool SupportsUserTwoFactorRecoveryCodes { get { throw null; } } + public virtual System.Linq.IQueryable Users { get { throw null; } } + public System.Collections.Generic.IList> UserValidators { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task AccessFailedAsync(TUser user) { throw null; } + public virtual System.Threading.Tasks.Task AddClaimAsync(TUser user, System.Security.Claims.Claim claim) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task AddClaimsAsync(TUser user, System.Collections.Generic.IEnumerable claims) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task AddLoginAsync(TUser user, Microsoft.AspNetCore.Identity.UserLoginInfo login) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task AddPasswordAsync(TUser user, string password) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task AddToRoleAsync(TUser user, string role) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task AddToRolesAsync(TUser user, System.Collections.Generic.IEnumerable roles) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task ChangeEmailAsync(TUser user, string newEmail, string token) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task ChangePasswordAsync(TUser user, string currentPassword, string newPassword) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task ChangePhoneNumberAsync(TUser user, string phoneNumber, string token) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task CheckPasswordAsync(TUser user, string password) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task ConfirmEmailAsync(TUser user, string token) { throw null; } + public virtual System.Threading.Tasks.Task CountRecoveryCodesAsync(TUser user) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task CreateAsync(TUser user) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task CreateAsync(TUser user, string password) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task CreateSecurityTokenAsync(TUser user) { throw null; } + protected virtual string CreateTwoFactorRecoveryCode() { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(TUser user) { throw null; } + public void Dispose() { } + protected virtual void Dispose(bool disposing) { } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task FindByEmailAsync(string email) { throw null; } + public virtual System.Threading.Tasks.Task FindByIdAsync(string userId) { throw null; } + public virtual System.Threading.Tasks.Task FindByLoginAsync(string loginProvider, string providerKey) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task FindByNameAsync(string userName) { throw null; } + public virtual System.Threading.Tasks.Task GenerateChangeEmailTokenAsync(TUser user, string newEmail) { throw null; } + public virtual System.Threading.Tasks.Task GenerateChangePhoneNumberTokenAsync(TUser user, string phoneNumber) { throw null; } + public virtual System.Threading.Tasks.Task GenerateConcurrencyStampAsync(TUser user) { throw null; } + public virtual System.Threading.Tasks.Task GenerateEmailConfirmationTokenAsync(TUser user) { throw null; } + public virtual string GenerateNewAuthenticatorKey() { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task> GenerateNewTwoFactorRecoveryCodesAsync(TUser user, int number) { throw null; } + public virtual System.Threading.Tasks.Task GeneratePasswordResetTokenAsync(TUser user) { throw null; } + public virtual System.Threading.Tasks.Task GenerateTwoFactorTokenAsync(TUser user, string tokenProvider) { throw null; } + public virtual System.Threading.Tasks.Task GenerateUserTokenAsync(TUser user, string tokenProvider, string purpose) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task GetAccessFailedCountAsync(TUser user) { throw null; } + public virtual System.Threading.Tasks.Task GetAuthenticationTokenAsync(TUser user, string loginProvider, string tokenName) { throw null; } + public virtual System.Threading.Tasks.Task GetAuthenticatorKeyAsync(TUser user) { throw null; } + protected static string GetChangeEmailTokenPurpose(string newEmail) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task> GetClaimsAsync(TUser user) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task GetEmailAsync(TUser user) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task GetLockoutEnabledAsync(TUser user) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task GetLockoutEndDateAsync(TUser user) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task> GetLoginsAsync(TUser user) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task GetPhoneNumberAsync(TUser user) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task> GetRolesAsync(TUser user) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task GetSecurityStampAsync(TUser user) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task GetTwoFactorEnabledAsync(TUser user) { throw null; } + public virtual System.Threading.Tasks.Task GetUserAsync(System.Security.Claims.ClaimsPrincipal principal) { throw null; } + public virtual string GetUserId(System.Security.Claims.ClaimsPrincipal principal) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task GetUserIdAsync(TUser user) { throw null; } + public virtual string GetUserName(System.Security.Claims.ClaimsPrincipal principal) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task GetUserNameAsync(TUser user) { throw null; } + public virtual System.Threading.Tasks.Task> GetUsersForClaimAsync(System.Security.Claims.Claim claim) { throw null; } + public virtual System.Threading.Tasks.Task> GetUsersInRoleAsync(string roleName) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task> GetValidTwoFactorProvidersAsync(TUser user) { throw null; } + public virtual System.Threading.Tasks.Task HasPasswordAsync(TUser user) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task IsEmailConfirmedAsync(TUser user) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task IsInRoleAsync(TUser user, string role) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task IsLockedOutAsync(TUser user) { throw null; } + public virtual System.Threading.Tasks.Task IsPhoneNumberConfirmedAsync(TUser user) { throw null; } + public virtual string NormalizeEmail(string email) { throw null; } + public virtual string NormalizeName(string name) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task RedeemTwoFactorRecoveryCodeAsync(TUser user, string code) { throw null; } + public virtual void RegisterTokenProvider(string providerName, Microsoft.AspNetCore.Identity.IUserTwoFactorTokenProvider provider) { } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task RemoveAuthenticationTokenAsync(TUser user, string loginProvider, string tokenName) { throw null; } + public virtual System.Threading.Tasks.Task RemoveClaimAsync(TUser user, System.Security.Claims.Claim claim) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task RemoveClaimsAsync(TUser user, System.Collections.Generic.IEnumerable claims) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task RemoveFromRoleAsync(TUser user, string role) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task RemoveFromRolesAsync(TUser user, System.Collections.Generic.IEnumerable roles) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task RemoveLoginAsync(TUser user, string loginProvider, string providerKey) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task RemovePasswordAsync(TUser user) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task ReplaceClaimAsync(TUser user, System.Security.Claims.Claim claim, System.Security.Claims.Claim newClaim) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task ResetAccessFailedCountAsync(TUser user) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task ResetAuthenticatorKeyAsync(TUser user) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task ResetPasswordAsync(TUser user, string token, string newPassword) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task SetAuthenticationTokenAsync(TUser user, string loginProvider, string tokenName, string tokenValue) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task SetEmailAsync(TUser user, string email) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task SetLockoutEnabledAsync(TUser user, bool enabled) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task SetLockoutEndDateAsync(TUser user, System.DateTimeOffset? lockoutEnd) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task SetPhoneNumberAsync(TUser user, string phoneNumber) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task SetTwoFactorEnabledAsync(TUser user, bool enabled) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task SetUserNameAsync(TUser user, string userName) { throw null; } + protected void ThrowIfDisposed() { } + public virtual System.Threading.Tasks.Task UpdateAsync(TUser user) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task UpdateNormalizedEmailAsync(TUser user) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task UpdateNormalizedUserNameAsync(TUser user) { throw null; } + protected virtual System.Threading.Tasks.Task UpdatePasswordHash(TUser user, string newPassword, bool validatePassword) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task UpdateSecurityStampAsync(TUser user) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + protected virtual System.Threading.Tasks.Task UpdateUserAsync(TUser user) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + protected System.Threading.Tasks.Task ValidatePasswordAsync(TUser user, string password) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + protected System.Threading.Tasks.Task ValidateUserAsync(TUser user) { throw null; } + public virtual System.Threading.Tasks.Task VerifyChangePhoneNumberTokenAsync(TUser user, string token, string phoneNumber) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + protected virtual System.Threading.Tasks.Task VerifyPasswordAsync(Microsoft.AspNetCore.Identity.IUserPasswordStore store, TUser user, string password) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task VerifyTwoFactorTokenAsync(TUser user, string tokenProvider, string token) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task VerifyUserTokenAsync(TUser user, string tokenProvider, string purpose, string token) { throw null; } + } + public partial class UserOptions + { + public UserOptions() { } + public string AllowedUserNameCharacters { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public bool RequireUniqueEmail { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + } + public partial class UserValidator : Microsoft.AspNetCore.Identity.IUserValidator where TUser : class + { + public UserValidator(Microsoft.AspNetCore.Identity.IdentityErrorDescriber errors = null) { } + public Microsoft.AspNetCore.Identity.IdentityErrorDescriber Describer { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + [System.Diagnostics.DebuggerStepThroughAttribute] + public virtual System.Threading.Tasks.Task ValidateAsync(Microsoft.AspNetCore.Identity.UserManager manager, TUser user) { throw null; } + } +} +namespace Microsoft.Extensions.DependencyInjection +{ + public static partial class IdentityServiceCollectionExtensions + { + public static Microsoft.AspNetCore.Identity.IdentityBuilder AddIdentityCore(this Microsoft.Extensions.DependencyInjection.IServiceCollection services) where TUser : class { throw null; } + public static Microsoft.AspNetCore.Identity.IdentityBuilder AddIdentityCore(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action setupAction) where TUser : class { throw null; } + } +} +namespace System.Security.Claims +{ + public static partial class PrincipalExtensions + { + public static string FindFirstValue(this System.Security.Claims.ClaimsPrincipal principal, string claimType) { throw null; } + } +} diff --git a/src/Identity/Extensions.Core/src/Microsoft.Extensions.Identity.Core.csproj b/src/Identity/Extensions.Core/src/Microsoft.Extensions.Identity.Core.csproj index 526f2bd7e7fe..56f0243273c4 100644 --- a/src/Identity/Extensions.Core/src/Microsoft.Extensions.Identity.Core.csproj +++ b/src/Identity/Extensions.Core/src/Microsoft.Extensions.Identity.Core.csproj @@ -2,8 +2,9 @@ ASP.NET Core Identity is the membership system for building ASP.NET Core web applications, including membership, login, and user data. ASP.NET Core Identity allows you to add login features to your application and makes it easy to customize data about the logged in user. - netcoreapp3.0 + netstandard2.0;netcoreapp3.0 true + true true aspnetcore;identity;membership @@ -12,6 +13,7 @@ + diff --git a/src/Identity/Extensions.Core/src/PasswordHasher.cs b/src/Identity/Extensions.Core/src/PasswordHasher.cs index a9ee0cd6bff4..54c7fd212672 100644 --- a/src/Identity/Extensions.Core/src/PasswordHasher.cs +++ b/src/Identity/Extensions.Core/src/PasswordHasher.cs @@ -65,6 +65,28 @@ public PasswordHasher(IOptions optionsAccessor = null) _rng = options.Rng; } +#if NETSTANDARD2_0 + // Compares two byte arrays for equality. The method is specifically written so that the loop is not optimized. + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] + private static bool ByteArraysEqual(byte[] a, byte[] b) + { + if (a == null && b == null) + { + return true; + } + if (a == null || b == null || a.Length != b.Length) + { + return false; + } + var areSame = true; + for (var i = 0; i < a.Length; i++) + { + areSame &= (a[i] == b[i]); + } + return areSame; + } +#endif + /// /// Returns a hashed representation of the supplied for the specified . /// @@ -222,7 +244,13 @@ private static bool VerifyHashedPasswordV2(byte[] hashedPassword, string passwor // Hash the incoming password and verify it byte[] actualSubkey = KeyDerivation.Pbkdf2(password, salt, Pbkdf2Prf, Pbkdf2IterCount, Pbkdf2SubkeyLength); +#if NETSTANDARD2_0 + return ByteArraysEqual(actualSubkey, expectedSubkey); +#elif NETCOREAPP3_0 return CryptographicOperations.FixedTimeEquals(actualSubkey, expectedSubkey); +#else +#error Update target frameworks +#endif } private static bool VerifyHashedPasswordV3(byte[] hashedPassword, string password, out int iterCount) @@ -255,7 +283,13 @@ private static bool VerifyHashedPasswordV3(byte[] hashedPassword, string passwor // Hash the incoming password and verify it byte[] actualSubkey = KeyDerivation.Pbkdf2(password, salt, prf, iterCount, subkeyLength); +#if NETSTANDARD2_0 + return ByteArraysEqual(actualSubkey, expectedSubkey); +#elif NETCOREAPP3_0 return CryptographicOperations.FixedTimeEquals(actualSubkey, expectedSubkey); +#else +#error Update target frameworks +#endif } catch { diff --git a/src/Identity/Extensions.Stores/ref/Microsoft.Extensions.Identity.Stores.csproj b/src/Identity/Extensions.Stores/ref/Microsoft.Extensions.Identity.Stores.csproj index bfb85db1d0fb..77cdf717c7b7 100644 --- a/src/Identity/Extensions.Stores/ref/Microsoft.Extensions.Identity.Stores.csproj +++ b/src/Identity/Extensions.Stores/ref/Microsoft.Extensions.Identity.Stores.csproj @@ -1,10 +1,10 @@ - netcoreapp3.0 + netstandard2.0 - - + + diff --git a/src/Identity/Extensions.Stores/ref/Microsoft.Extensions.Identity.Stores.netcoreapp3.0.cs b/src/Identity/Extensions.Stores/ref/Microsoft.Extensions.Identity.Stores.netstandard2.0.cs similarity index 100% rename from src/Identity/Extensions.Stores/ref/Microsoft.Extensions.Identity.Stores.netcoreapp3.0.cs rename to src/Identity/Extensions.Stores/ref/Microsoft.Extensions.Identity.Stores.netstandard2.0.cs diff --git a/src/Identity/Extensions.Stores/src/Microsoft.Extensions.Identity.Stores.csproj b/src/Identity/Extensions.Stores/src/Microsoft.Extensions.Identity.Stores.csproj index b51bcb7b27d1..a3fd7e5c6588 100644 --- a/src/Identity/Extensions.Stores/src/Microsoft.Extensions.Identity.Stores.csproj +++ b/src/Identity/Extensions.Stores/src/Microsoft.Extensions.Identity.Stores.csproj @@ -2,8 +2,9 @@ ASP.NET Core Identity is the membership system for building ASP.NET Core web applications, including membership, login, and user data. ASP.NET Core Identity allows you to add login features to your application and makes it easy to customize data about the logged in user. - netcoreapp3.0 + netstandard2.0 true + true true aspnetcore;identity;membership @@ -11,6 +12,7 @@ + diff --git a/src/Shared/WebEncoders/WebEncoders.cs b/src/Shared/WebEncoders/WebEncoders.cs index 979ab5d2d7f5..6ccec330c730 100644 --- a/src/Shared/WebEncoders/WebEncoders.cs +++ b/src/Shared/WebEncoders/WebEncoders.cs @@ -2,7 +2,9 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +#if NETCOREAPP3_0 using System.Buffers; +#endif using System.Diagnostics; using System.Globalization; using Microsoft.Extensions.WebEncoders.Sources;