Add project files.

This commit is contained in:
Khwezi Mngoma
2026-06-05 22:07:25 +02:00
parent 59ea7de742
commit 437e8c5c08
978 changed files with 151911 additions and 0 deletions
@@ -0,0 +1,22 @@
// Copyright (c) Jan Škoruba. All Rights Reserved.
// Licensed under the Apache License, Version 2.0.
using System.Threading.Tasks;
using Duende.IdentityServer.Events;
using Duende.IdentityServer.Services;
using Microsoft.Extensions.Logging;
namespace LiteCharmsSecurity.STS.Identity.Services
{
public class AuditEventSink : DefaultEventSink
{
public AuditEventSink(ILogger<DefaultEventService> logger) : base(logger)
{
}
public override Task PersistAsync(Event evt)
{
return base.PersistAsync(evt);
}
}
}
@@ -0,0 +1,31 @@
using System;
using System.Linq;
using Duende.IdentityServer.Hosting.DynamicProviders;
using Duende.IdentityServer.Models;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
using Microsoft.AspNetCore.Http;
using LiteCharmsSecurity.STS.Identity.Helpers;
using System.Security.Claims;
using Microsoft.Extensions.Logging;
using Microsoft.IdentityModel.Tokens;
namespace LiteCharmsSecurity.STS.Identity.Services;
public class OpenIdClaimsMappingConfig : ConfigureAuthenticationOptions<OpenIdConnectOptions, OidcProvider>
{
public OpenIdClaimsMappingConfig(IHttpContextAccessor httpContextAccessor, ILogger<ConfigureAuthenticationOptions<OpenIdConnectOptions, OidcProvider>> logger) : base(httpContextAccessor, logger)
{
}
protected override void Configure(ConfigureAuthenticationContext<OpenIdConnectOptions, OidcProvider> context)
{
var oidcProvider = context.IdentityProvider;
context.IdentityProvider.Properties.TryGetValue("MapInboundClaims", out var resultMapInboundClaims);
var mapInboundClaims = resultMapInboundClaims == null || "true".Equals(resultMapInboundClaims);
context.AuthenticationOptions.MapInboundClaims = mapInboundClaims;
}
}