Skip to content

TagHelpers firewall detect

ASP-WAF Support Team edited this page Feb 22, 2021 · 2 revisions

firewall tag helpers User discovery injection

When the ASP.Net framework serves a page you can instruct it to have the firewall inject the user detection script. There are several ways you can do this. It can be achieved manually or via the firewall-detect attribute

Option 1 call the script manually

<script src="@Url.Content(Walter.Web.FireWall.DefaultEndpoints.DefaultLinks.UserEndpointJavaScript)"></script>

Option 2 use the <body> tag to inject the script

<body firewall-detect>
<!-- your content-->

<body/>

If you have customized the default script and you would like the firewall to use the new script you can specify the custom script using the user-detection attribute, the bellow sample shows how to this using a custom script named ~/js/UserDetect.js.

<body firewall-detect firewall-detect-src="~/js/UserDetect.js">
   <!-- your content-->

<body/>

Option 3 use the <script> tag to inject the script

As with the tag, the <script> tag allows you to inject the user detection script or override the script using a custom script path. The following sample shows how to use the firewall-detect attribute

<body>
    <!-- your content-->


    <script src="~/lib/jquery/dist/jquery.min.js"></script>
    <script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
    <script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
    <script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>
    <script firewall-detect></script>
    @RenderSection("Scripts", required: false)
<body/>
Clone this wiki locally