NDB.Security.Authentication.Identity removed "basic" keyword from code

messaging
Tudor Stanciu 2021-06-26 21:31:31 +03:00
parent 5f40130ada
commit e842f56caf
4 changed files with 13 additions and 13 deletions

View File

@ -6,15 +6,15 @@ using System;
namespace NDB.Security.Authentication.Identity namespace NDB.Security.Authentication.Identity
{ {
public static class BasicAuthenticationExtensions public static class AuthenticationExtensions
{ {
public static IServiceCollection AddBasicAuthentication(this IServiceCollection services, string identityServerBaseAddress) public static IServiceCollection AddAuthentication(this IServiceCollection services, string identityServerBaseAddress)
{ {
services.AddBasicAuthentication(identityServerBaseAddress, new Services.AuthenticationOptions()); services.AddAuthentication(identityServerBaseAddress, new Services.AuthenticationOptions());
return services; return services;
} }
public static IServiceCollection AddBasicAuthentication(this IServiceCollection services, string identityServerBaseAddress, IAuthenticationOptions authenticationOptions) public static IServiceCollection AddAuthentication(this IServiceCollection services, string identityServerBaseAddress, IAuthenticationOptions authenticationOptions)
{ {
Validate(identityServerBaseAddress, authenticationOptions); Validate(identityServerBaseAddress, authenticationOptions);
@ -22,9 +22,9 @@ namespace NDB.Security.Authentication.Identity
services.UseIdentityServices(identityServerBaseAddress); services.UseIdentityServices(identityServerBaseAddress);
services.AddSingleton(authenticationOptions); services.AddSingleton(authenticationOptions);
// configure basic authentication // configure authentication
services.AddAuthentication("BasicAuthentication") AuthenticationServiceCollectionExtensions.AddAuthentication(services, "IdentityAuthentication")
.AddScheme<AuthenticationSchemeOptions, BasicAuthenticationHandler>("BasicAuthentication", null); .AddScheme<AuthenticationSchemeOptions, IdentityAuthenticationHandler>("IdentityAuthentication", null);
return services; return services;
} }

View File

@ -11,12 +11,12 @@ using System.Threading.Tasks;
namespace NDB.Security.Authentication.Identity namespace NDB.Security.Authentication.Identity
{ {
public class BasicAuthenticationHandler : AuthenticationHandler<AuthenticationSchemeOptions> public class IdentityAuthenticationHandler : AuthenticationHandler<AuthenticationSchemeOptions>
{ {
private readonly IIdentityService _identityService; private readonly IIdentityService _identityService;
private readonly IAuthenticationOptions _authenticationOptions; private readonly IAuthenticationOptions _authenticationOptions;
public BasicAuthenticationHandler(IOptionsMonitor<AuthenticationSchemeOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock, IIdentityService identityService, IAuthenticationOptions authenticationOptions) public IdentityAuthenticationHandler(IOptionsMonitor<AuthenticationSchemeOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock, IIdentityService identityService, IAuthenticationOptions authenticationOptions)
: base(options, logger, encoder, clock) : base(options, logger, encoder, clock)
{ {
_identityService = identityService; _identityService = identityService;

View File

@ -2,12 +2,12 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
<Description>Add basic authentication handler with inhouse identity server</Description> <Description>Add authentication handler with inhouse identity server</Description>
<PackageProjectUrl>https://dev.azure.com/tstanciu94/NDB</PackageProjectUrl> <PackageProjectUrl>https://dev.azure.com/tstanciu94/NDB</PackageProjectUrl>
<RepositoryUrl>https://dev.azure.com/tstanciu94/NDB</RepositoryUrl> <RepositoryUrl>https://dev.azure.com/tstanciu94/NDB</RepositoryUrl>
<RepositoryType>Git</RepositoryType> <RepositoryType>Git</RepositoryType>
<PackageTags>NDB BasicAuthentication Identity</PackageTags> <PackageTags>NDB Authentication Identity</PackageTags>
<Version>1.0.1</Version> <Version>1.0.2</Version>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -22,7 +22,7 @@ dotnet nuget push NDB.Extensions.Swagger.1.0.1.nupkg -k ***REMOVED*** -s http://
dotnet nuget push NDB.Extensions.Http.1.0.0.nupkg -k ***REMOVED*** -s http://stawebsrv:8081/NuGetServer/nuget dotnet nuget push NDB.Extensions.Http.1.0.0.nupkg -k ***REMOVED*** -s http://stawebsrv:8081/NuGetServer/nuget
dotnet nuget push NDB.Security.Authentication.Identity.1.0.1.nupkg -k ***REMOVED*** -s http://stawebsrv:8081/NuGetServer/nuget dotnet nuget push NDB.Security.Authentication.Identity.1.0.2.nupkg -k ***REMOVED*** -s http://stawebsrv:8081/NuGetServer/nuget
dotnet nuget push NDB.Extensions.Caching.1.0.0.nupkg -k ***REMOVED*** -s http://stawebsrv:8081/NuGetServer/nuget dotnet nuget push NDB.Extensions.Caching.1.0.0.nupkg -k ***REMOVED*** -s http://stawebsrv:8081/NuGetServer/nuget
####################################################################################################################################################### #######################################################################################################################################################