Hi,
How can we identify the client details in App service?
Like: Browser, Ip. ( Audit log )
Thanks.
5 Answer(s)
-
0
You can inject IClientInfoProvider and use it like this:
var browserInfo = ClientInfoProvider.BrowserInfo; var clientIpAddress = ClientInfoProvider.ClientIpAddress; var clientName = ClientInfoProvider.ComputerName;
-
0
Hi,
Is there any way to trigger user-defined class, When any web-API called.
Like-- When user triggered create user app-services or any other service[Webapi] then we want to trigger [user-defined class] with auditing details.
eg. like insert in Abpauditlog.
-
0
Hi,
If you need something other than AuditLogs, you can create a similar interceptor like AuditingInterceptor, see <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/master/src/Abp/Auditing/AuditingInterceptor.cs">https://github.com/aspnetboilerplate/as ... rceptor.cs</a>.
You can check it's usage in ABP Framework.
-
0
Hi,
Can you suggest me a way to trigger AuditingTrigger Class for the each and every web-API request?
We need to trigger this automatically on web-API call.
Thanks
-
0
Refer to this Stack Overflow answer on how to inject IClientInfoProvider in a custom interceptor: Authorize application service based on client IP address
You can:
- Skip the attribute.
- Modify ShouldIntercept to return typeof(IApplicationService).IsAssignableFrom(type);
- Inject and call AuditingTrigger in the Intercept method.