Applied authentik endpoint protection
This commit is contained in:
@@ -54,13 +54,13 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="LiteCharms.Features" Version="1.72.0" />
|
<PackageReference Include="LiteCharms.Features" Version="1.77.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<!-- UI -->
|
<!-- UI -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ANM.Blazored.Toast" Version="0.1.1" />
|
<PackageReference Include="ANM.Blazored.Toast" Version="0.1.1" />
|
||||||
<PackageReference Include="LiteCharms.Features.MidrandBooks" Version="1.72.0" />
|
<PackageReference Include="LiteCharms.Features.MidrandBooks" Version="1.77.0" />
|
||||||
|
|
||||||
<!-- Global Usings -->
|
<!-- Global Usings -->
|
||||||
<Using Include="Blazored.Toast.Services" />
|
<Using Include="Blazored.Toast.Services" />
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
using LiteCharms.Features.Abstractions;
|
||||||
|
using LiteCharms.Features.Api;
|
||||||
|
using LiteCharms.Features.Extensions;
|
||||||
|
|
||||||
|
namespace MidrandBooksApi.Payments.Endpoints;
|
||||||
|
|
||||||
|
[ApiVersionTarget(1)]
|
||||||
|
public class IdentityEndpoint : IEndpoint
|
||||||
|
{
|
||||||
|
public void Map(IEndpointRouteBuilder builder)
|
||||||
|
{
|
||||||
|
builder.MapGet("security/test", () =>
|
||||||
|
{
|
||||||
|
return Results.Ok();
|
||||||
|
})
|
||||||
|
.RequireAuthorization()
|
||||||
|
.WithDescription("Security test endpoint")
|
||||||
|
.WithName(typeof(IdentityEndpoint).ToEndpointName())
|
||||||
|
.Produces(StatusCodes.Status200OK)
|
||||||
|
.WithTags("Security")
|
||||||
|
.MapToApiVersion(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
|
using LiteCharms.Features.Api.Configuration;
|
||||||
using LiteCharms.Features.Extensions;
|
using LiteCharms.Features.Extensions;
|
||||||
using LiteCharms.Features.Mediator;
|
using LiteCharms.Features.Mediator;
|
||||||
using LiteCharms.Features.MidrandBooks.Extensions;
|
using LiteCharms.Features.MidrandBooks.Extensions;
|
||||||
|
using Microsoft.Extensions.Options;
|
||||||
using static LiteCharms.Features.Extensions.Quartz;
|
using static LiteCharms.Features.Extensions.Quartz;
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
@@ -11,10 +13,8 @@ builder.Services.AddEndpointsApiExplorer();
|
|||||||
builder.Services.AddEndpoints(Assembly.GetExecutingAssembly());
|
builder.Services.AddEndpoints(Assembly.GetExecutingAssembly());
|
||||||
builder.Services.AddApiServices(builder.Configuration);
|
builder.Services.AddApiServices(builder.Configuration);
|
||||||
|
|
||||||
builder.Services.AddAuthorization();
|
|
||||||
builder.Services.AddAuthentication();
|
|
||||||
|
|
||||||
builder.Services.AddMediator();
|
builder.Services.AddMediator();
|
||||||
|
builder.Services.AddAuthentic(builder.Configuration);
|
||||||
|
|
||||||
builder.Services.AddScoped(typeof(IPipelineBehavior<,>), typeof(TelemetryPipelineBehavior<,>));
|
builder.Services.AddScoped(typeof(IPipelineBehavior<,>), typeof(TelemetryPipelineBehavior<,>));
|
||||||
builder.Services.AddScoped(typeof(IPipelineBehavior<,>), typeof(LoggingPipelineBehavior<,>));
|
builder.Services.AddScoped(typeof(IPipelineBehavior<,>), typeof(LoggingPipelineBehavior<,>));
|
||||||
|
|||||||
@@ -1,4 +1,13 @@
|
|||||||
{
|
{
|
||||||
|
"AuthentikSettings": {
|
||||||
|
"Authority": "https://id.khongisa.co.za/application/o/midrand-books-api-uat/",
|
||||||
|
"IntrospectionUrl": "https://id.khongisa.co.za/application/o/introspect/",
|
||||||
|
"ApiResourceName": "i6ygr84HlnhxFYqLJVJ2HhdlVrOYE4PnurT5cPQW",
|
||||||
|
"ApiResourceSecret": "tvPUM3Vqfk2sra99s9lN3Yli0ylaGT6vbQBqfH7KvSIbTeJ6dZGB12NW4MxqDDWJexP7vXfjTAZtR3j3ivD6cTJr5xQ9S4rpFnSfY4Fi69RNwRvKHj8hVrd3wobq6ODG",
|
||||||
|
"RequiredClaimName": "scope",
|
||||||
|
"RequiredClaimNameValue": "openid",
|
||||||
|
"RequireHttpsMetadata": true
|
||||||
|
},
|
||||||
"ValidPayfastHosts": [
|
"ValidPayfastHosts": [
|
||||||
"www.payfast.co.za",
|
"www.payfast.co.za",
|
||||||
"sandbox.payfast.co.za",
|
"sandbox.payfast.co.za",
|
||||||
|
|||||||
Reference in New Issue
Block a user