From 985f97283d81f79d40596943a2d6988a1df41d46 Mon Sep 17 00:00:00 2001 From: janskoruba Date: Mon, 4 Nov 2019 16:58:05 +0100 Subject: [PATCH] Add link for audit logging from user profile --- .../Views/Identity/UserProfile.en.resx | 3 +++ .../Views/Identity/UserProfile.cshtml | 1 + .../Services/AuditEventSink.cs | 19 +++++++++++++++++++ ...koruba.IdentityServer4.STS.Identity.csproj | 5 +++++ 4 files changed, 28 insertions(+) create mode 100644 src/Skoruba.IdentityServer4.STS.Identity/Services/AuditEventSink.cs diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Identity/UserProfile.en.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Identity/UserProfile.en.resx index 3f7717a18..0b08dc710 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Identity/UserProfile.en.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Identity/UserProfile.en.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Audit Log + Change Password diff --git a/src/Skoruba.IdentityServer4.Admin/Views/Identity/UserProfile.cshtml b/src/Skoruba.IdentityServer4.Admin/Views/Identity/UserProfile.cshtml index 4fb21f778..ba75e18e1 100644 --- a/src/Skoruba.IdentityServer4.Admin/Views/Identity/UserProfile.cshtml +++ b/src/Skoruba.IdentityServer4.Admin/Views/Identity/UserProfile.cshtml @@ -34,6 +34,7 @@ @Localizer["ButtonManageUserClaims"] @Localizer["ButtonManageUserRoles"] @Localizer["ButtonManageUserExternalProviders"] + @Localizer["Audit Log"] @Localizer["ButtonChangePassword"] @Localizer["ButtonDeleteUser"] diff --git a/src/Skoruba.IdentityServer4.STS.Identity/Services/AuditEventSink.cs b/src/Skoruba.IdentityServer4.STS.Identity/Services/AuditEventSink.cs new file mode 100644 index 000000000..559888a78 --- /dev/null +++ b/src/Skoruba.IdentityServer4.STS.Identity/Services/AuditEventSink.cs @@ -0,0 +1,19 @@ +using System.Threading.Tasks; +using IdentityServer4.Events; +using IdentityServer4.Services; +using Microsoft.Extensions.Logging; + +namespace Skoruba.IdentityServer4.STS.Identity.Services +{ + public class AuditEventSink : DefaultEventSink + { + public AuditEventSink(ILogger logger) : base(logger) + { + } + + public override Task PersistAsync(Event evt) + { + return base.PersistAsync(evt); + } + } +} \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.STS.Identity/Skoruba.IdentityServer4.STS.Identity.csproj b/src/Skoruba.IdentityServer4.STS.Identity/Skoruba.IdentityServer4.STS.Identity.csproj index 108a933ba..6c7a22af1 100644 --- a/src/Skoruba.IdentityServer4.STS.Identity/Skoruba.IdentityServer4.STS.Identity.csproj +++ b/src/Skoruba.IdentityServer4.STS.Identity/Skoruba.IdentityServer4.STS.Identity.csproj @@ -17,6 +17,7 @@ + @@ -25,4 +26,8 @@ + + + +