Description: The Security Logs page displays incorrect browser information for all user activity entries. Regardless of the actual browser used to access the application, the Browser field always displays “Mozilla” instead of identifying the specific browser correctly (e.g., Chrome, Edge, Firefox). The same IP address is displayed for all entries in the Security Logs page.
Steps to Reproduce:
Log in to the Dispensing application using different browsers (e.g., Chrome, Edge, Firefox) Navigate to the Security Logs page Observe the Browser details displayed for login/activity entries
Actual Result: All entries display the browser as “Mozilla” Actual browser information is not identified correctly The same IP address is displayed for all entries in the Security Logs page. The browser details and application details are not completely visible to the user.
Expected Result: System should correctly display the actual browser name used for the session (e.g., Google Chrome, Microsoft Edge, Firefox) Each Security Log entry should display the correct and corresponding IP address based on the user's activity/session. The browser details and application details should be fully visible to the user without truncation.
2 Answer(s)
-
0
Hi,
The Browser column keeps the raw
User-Agentheader, and every modern browser sends one that starts withMozilla/5.0. Chrome, Edge and Firefox are named further along the same string, so the column width is what hides them, not the recorded value.The IP address is a different case. One address on every entry, and a link-local one at that, is what you get when the application runs behind a reverse proxy: the generated host never takes the client address from
X-Forwarded-For, so each entry is stamped with the proxy IP instead. Add this at the end ofConfigureServicesin the module that serves the login page (*HttpApiHostModule, or*AuthServerModuleif your solution has a separate auth server):Configure<ForwardedHeadersOptions>(options => { options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto; options.KnownNetworks.Clear(); options.KnownProxies.Clear(); });The two
Clear()calls are the part that is easy to miss. The middleware trusts only loopback addresses out of the box, so without themX-Forwarded-Foris dropped without any error and you keep seeing the proxy address. Clear them only when your application cannot be reached except through the proxy, otherwise a caller that bypasses it can spoof its IP. On .NET 10 the same list is namedKnownIPNetworks.For the truncated columns you can show the full
User-Agentand application name on hover with an entity prop contributor:// src/app/security-log-prop-contributors.ts import { escapeHtmlChars } from '@abp/ng.core'; import { EntityProp, EntityPropList } from '@abp/ng.components/extensible'; import { IdentitySecurityLogDto } from '@volo/abp.commercial.ng.ui/config'; import { eIdentityComponents } from '@volo/abp.ng.identity'; import { of } from 'rxjs'; function showFullValueOnHover( propList: EntityPropList<IdentitySecurityLogDto>, name: 'browserInfo' | 'applicationName', ) { const index = propList.indexOf(name, (value, propName) => value.name === propName); const droppedNode = propList.dropByIndex(index)!; propList.addByIndex( new EntityProp<IdentitySecurityLogDto>({ ...droppedNode.value, valueResolver: data => { const value = escapeHtmlChars(data.record[name]) || ''; return of(`<div class="abp-ellipsis-inline" title="${value}">${value}</div>`); }, }), index, ); } // The exported contributor type does not list the security logs page yet. export const identityEntityPropContributors = { [eIdentityComponents.SecurityLogs]: [ (propList: EntityPropList<IdentitySecurityLogDto>) => { showFullValueOnHover(propList, 'browserInfo'); showFullValueOnHover(propList, 'applicationName'); }, ], } as any;Then pass it to the identity route in
app.routes.ts:{ path: 'identity', loadChildren: () => import('@volo/abp.ng.identity').then(c => c.createRoutes({ entityPropContributors: identityEntityPropContributors }), ), },The next release will show the full value on hover without this contributor, and the contributor type will accept the security logs page so the cast is no longer needed.
Thanks
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
