diff --git a/modules/identity/src/Volo.Abp.Identity.AspNetCore/Volo/Abp/Identity/AspNetCore/ExternalLoginProviderBase.cs b/modules/identity/src/Volo.Abp.Identity.AspNetCore/Volo/Abp/Identity/AspNetCore/ExternalLoginProviderBase.cs new file mode 100644 index 0000000000..9871fb788c --- /dev/null +++ b/modules/identity/src/Volo.Abp.Identity.AspNetCore/Volo/Abp/Identity/AspNetCore/ExternalLoginProviderBase.cs @@ -0,0 +1,16 @@ +using System.Threading.Tasks; + +namespace Volo.Abp.Identity.AspNetCore +{ + public abstract class ExternalLoginProviderBase : IExternalLoginProvider + { + public abstract Task TryAuthenticateAsync(string userName, string plainPassword); + + public abstract Task CreateUserAsync(string userName); + + public virtual Task UpdateUserAsync(IdentityUser user) + { + return Task.CompletedTask; + } + } +} diff --git a/modules/identity/test/Volo.Abp.Identity.AspNetCore.Tests/Volo/Abp/Identity/AspNetCore/FakeExternalLoginProvider.cs b/modules/identity/test/Volo.Abp.Identity.AspNetCore.Tests/Volo/Abp/Identity/AspNetCore/FakeExternalLoginProvider.cs index 8dacdae65e..c95d65143f 100644 --- a/modules/identity/test/Volo.Abp.Identity.AspNetCore.Tests/Volo/Abp/Identity/AspNetCore/FakeExternalLoginProvider.cs +++ b/modules/identity/test/Volo.Abp.Identity.AspNetCore.Tests/Volo/Abp/Identity/AspNetCore/FakeExternalLoginProvider.cs @@ -4,18 +4,18 @@ using Volo.Abp.DependencyInjection; namespace Volo.Abp.Identity.AspNetCore { - public class FakeExternalLoginProvider : IExternalLoginProvider, ITransientDependency + public class FakeExternalLoginProvider : ExternalLoginProviderBase, ITransientDependency { public const string Name = "Fake"; - public Task TryAuthenticateAsync(string userName, string plainPassword) + public override Task TryAuthenticateAsync(string userName, string plainPassword) { return Task.FromResult( userName == "ext_user" && plainPassword == "abc" ); } - public Task CreateUserAsync(string userName) + public override Task CreateUserAsync(string userName) { return Task.FromResult( new IdentityUser( @@ -25,10 +25,5 @@ namespace Volo.Abp.Identity.AspNetCore ) ); } - - public Task UpdateUserAsync(IdentityUser user) - { - return Task.CompletedTask; - } } }