IdentityServer / IdentityServer4

OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
https://identityserver.io
Apache License 2.0
9.23k stars 4.02k forks source link

Auditing IdentityServer events in AdminUI causes crash #4665

Closed hallidev closed 4 years ago

hallidev commented 4 years ago

Version Info:

.NET Core 3.1

Relevant Package Info:

<PackageReference Include="IdentityExpress.Identity" Version="3.1.1" />
<PackageReference Include="IdentityServer4" Version="3.1.3" />
<PackageReference Include="IdentityServer4.AspNetIdentity" Version="3.1.3" />
<PackageReference Include="IdentityServer4.EntityFramework" Version="3.1.3" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.1.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.3">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.3" />
<PackageReference Include="RSK.Audit.EF" Version="1.0.0.35" />
<PackageReference Include="RSK.IdentityServer4.AuditEventSink" Version="1.0.0.19" />
<PackageReference Include="System.Security.Principal.Windows" Version="4.7.0" />

Issue / Steps to reproduce the problem

  1. Follow the steps found here: https://www.identityserver.com/articles/adminui-audit-event-sink
  2. Run IdentityServer
  3. Attempt to login
  4. Exception thrown

Relevant parts of the log file

MissingMethodException: Method not found: 'Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder`1.HasIndex(System.Linq.Expressions.Expression`1<System.Func`2<!0,System.Object>>)'.
RSK.Audit.EF.AuditDatabaseContext.OnModelCreating(ModelBuilder modelBuilder)

AuditWriteException: Failed to write audit entry User:7e845f49-5ee3-40ab-833e-3f77b860daeb(jhalliday):User Login Success:{
"Name": "User Login Success",
"Category": "Authentication",
"EventType": "Success",
"Id": 1000,
"Username": "REDACTED",
"SubjectId": "7e845f49-5ee3-40ab-833e-3f77b860daeb",
"DisplayName": "REDACTED",
"Endpoint": "UI",
"ActivityId": "80000017-0006-fc00-b63f-84710c7967bb",
"TimeStamp": "2020-07-16T18:29:07Z",
"ProcessId": 32284,
"LocalIpAddress": "::1:44312",
"RemoteIpAddress": "::1"
}:True
RSK.Audit.EF.AuditRecorder.WriteAuditRecord(IAuditEventArguments context, bool succeeded)
scottbrady91 commented 4 years ago

Hi, thanks for reporting this! Since this is for a commercial product, please could you submit this as a support ticket at support@identityserver.com. One of the AdminUI team should be able to look into this on Monday for you.

hallidev commented 4 years ago

Will do. We're actually in the middle of the purchasing process right now. I ran into this while getting a head start with the demo version. Should I wait until purchasing is complete before submitting a ticket?

scottbrady91 commented 4 years ago

Should I wait until purchasing is complete before submitting a ticket?

Not at all, we will still help you as you demo the product 🙂

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.