---
title: "How to Record a Browser Trace"
description: "How to record a browser trace for troubleshooting | Curity"
url: "https://curity.io/resources/learn/record-browser-trace/"
date: "2023-04-07"
area: "tutorials"
topic: "howtos"
pagegroup: "logging-monitoring"
---

# How to Record a Browser Trace

When integrating OAuth into applications, the [code flow](https://curity.io/resources/learn/oauth-code-flow/) is used. This involves a number of HTTP requests and responses. Sometimes it includes integration with third party systems, such as Microsoft Entra ID. In the event of an incorrect configuration, your identity experts may need to assist with troubleshooting. Capturing a browser trace enables them to visualize the HTTP requests and understand the cause.

A browser trace is a log of activity taking place in the browser when the browser is communicating with a web server running an application. The trace log captures activities such as requests sent to the server, how long it takes for a request to complete, responses to the requests and any errors that occur. With this, a browser trace gives a very detailed view of what is occurring as can give very detailed insight in troubleshooting an issue.

Your identity team, or the Curity support and Professional Services (PS) teams might request a browser trace log to be captured when troubleshooting an issue. Below are instructions that helps guide how to capture a browser trace log on some of the most common browsers.

Sensitive data

Data captured in browser trace logs could potentially contain sensitive data. Keep this in mind when recording the browser trace and when sharing the log. Refer to the [Sanitation](https://curity.io/resources/learn/record-browser-trace/#sanitation) section below for details on how to sanitize potential sensitive data.

## Capturing & Exporting the log

The most common browsers allow for a trace log to be captured as well as for that log to be exported in the [HTTP Archive (HAR)](https://en.wikipedia.org/wiki/HAR_(file_format)) format. This is the file format that will typically be requested by the Curity support and PS teams.

**Google Chrome**

1.  Launch the developer tools from the toolbar menu (1) under **More Tools** (2) → **Developer Tools** (3)

![Chrome Dev Tools](https://curity.io/images/resources/howtos/logging-monitoring/browser-trace/chrome-devtools.jpg)

2.  Configure the Developer Tools to preserve the log information. Navigate to the **Network** tab and enable `Preserve log` (1).
    
    Then make sure to clear the log from any previously recorded activity so that a clean log of only the reproduced issue is captured. Still on the **Network** tab, select **Stop recording network log** (2). When stopped, the indicator (2) should not be red. Next, clear the potentially previously recorded information by clicking **Clear** (3).
    

![Chrome Preserve Log](https://curity.io/images/resources/howtos/logging-monitoring/browser-trace/chrome-preserve-log.jpg)

3.  The state of the browser log should now be at a starting point with all previous activity cleared. Start to record the network log by clicking **Record network log** (1). When the recording is active the indicator should be red.
    
    Now reproduce the issue you are troubleshooting and watch the log fill with activity (2).
    
    The log data captured can be exported as a HAR file. Click the **Export HAR…** (3) button and choose a location and a filename to save the file.
    

![Chrome Network Log](https://curity.io/images/resources/howtos/logging-monitoring/browser-trace/chrome-network-log.jpg)

**Microsoft Edge**

1.  Launch the developer tools from the toolbar menu (1) under **More Tools** → **Developer Tools** (2).

![Microsoft Edge Dev Tools](https://curity.io/images/resources/howtos/logging-monitoring/browser-trace/edge-devtools.jpg)

2.  Configure the Developer Tools to preserve the log information. Navigate to the **Network** tab and enable `Preserve log` (1).
    
    Then make sure to clear the log from any previously recorded activity so that a clean log of only the reproduced issue is captured. Still on the **Network** tab, select **Stop recording network log** (2). When stopped, the indicator (2) should not be red.
    
    Next, clear the potentially previously recorded information by clicking **Clear** (3).
    

![Microsoft Edge Preserve Log](https://curity.io/images/resources/howtos/logging-monitoring/browser-trace/edge-preserve-log.jpg)

3.  The state of the browser log should now be at a starting point with all previous activity cleared. Start to record the network log by clicking **Record network log** (1). When the recording is active the indicator should be red. Now reproduce the issue you are troubleshooting and watch the log fill with activity.
    
    The log data captured can be exported as a HAR file. Click the **Export HAR...** (2) button and choose a location and a filename to save the file.
    

![Chrome Network Log](https://curity.io/images/resources/howtos/logging-monitoring/browser-trace/edge-export.jpg)

**Safari**

1.  First navigate to **Safari** → **Settings** → **Advanced**. From here make sure that you have enabled `Show Develop menu in menu bar`.

![Safari Settings](https://curity.io/images/resources/howtos/logging-monitoring/browser-trace/safari-settings.jpg)

2.  This will display the **Develop** menu in Safari and from there you can select **Show Web Inspector**. Next make sure that `Preserve Log` is enabled under the **Network** tab.

![Safari Preserve Log](https://curity.io/images/resources/howtos/logging-monitoring/browser-trace/safari-preserve-log.jpg)

3.  Then make sure to clear the log from any previously recorded activity so that a clean log of only the reproduced issue is captured. Still on the **Network** tab, click **Clear Network Items**.

![Safari Clear Log](https://curity.io/images/resources/howtos/logging-monitoring/browser-trace/safari-clear-log.jpg)

4.  The state of the browser log should now be at a starting point with all previous activity cleared. Now reproduce the issue you are troubleshooting and watch the log fill with activity.
    
    The log data captured can be exported as a HAR file. Click the \*\*Export \*\* button and choose a location and a filename to save the file.
    

![Safari Export](https://curity.io/images/resources/howtos/logging-monitoring/browser-trace/safari-export.jpg)

**Firefox**

1.  Launch the developer tools **Tools** → **Browser Tools** → **Web Developer Tools**.

![Firefox Dev Tools](https://curity.io/images/resources/howtos/logging-monitoring/browser-trace/ff-devtools.jpg)

2.  Configure the Web Developer Tools to persist the log information. Navigate to the **Network** tab and from the **Network Settings** menu make sure that `Persist Logs` is enabled.

![Firefox Persist Logs](https://curity.io/images/resources/howtos/logging-monitoring/browser-trace/ff-persist-logs.jpg)

3.  Then make sure to clear the log from any previously recorded activity so that a clean log of only the reproduced issue is captured. Still on the **Network** tab, click the **Clear the Web Console output** button.

![Firefox Clear Log](https://curity.io/images/resources/howtos/logging-monitoring/browser-trace/ff-clear-log.jpg)

4.  The state of the browser log should now be at a starting point with all previous activity cleared. Now reproduce the issue you are troubleshooting and watch the log fill with activity.
    
    The log data captured can be exported as a HAR file. From the **Network Settings** menu, click the **Save All As HAR** option and choose a location and a filename to save the file.
    

![Firefox Export](https://curity.io/images/resources/howtos/logging-monitoring/browser-trace/ff-export.jpg)

**Postman**

1.  In the Postman Desktop App, navigate to **View** → **Developer** → **Show DevTools (Current View)**.

![Postman DevTools](https://curity.io/images/resources/howtos/logging-monitoring/browser-trace/postman-devtools.jpg)

2.  In the Developer Tools that opens, navigate to the **Network** tab and check the box `Preserve log` (1). Then make sure to clear the log from any previously recorded activity so that a clean log of only the reproduced issue is captured. Still on the **Network** tab, select **Stop recording network log** (2). When stopped, the indicator (2) should not be red. Next, clear the potentially previously recorded information by clicking **Clear** (3).

![Postman Preserve Logs](https://curity.io/images/resources/howtos/logging-monitoring/browser-trace/postman-preserve-logs.jpg)

3.  The state of the Postman Developer Tool log should now be at a starting point with all previous activity cleared. Start to record the network log by clicking **Record network log** (1). When the recording is active the indicator should be red. Now reproduce the issue you are troubleshooting and watch the log fill with activity.
    
    The log data captured can be exported as a HAR file. Click the **Export HAR...** button (2) and choose a location and a filename to save the file.
    

![Postman Export](https://curity.io/images/resources/howtos/logging-monitoring/browser-trace/postman-export.jpg)

## Importing the Trace

Once a trace is captured it can be communicated to the identity experts, such as your IAM team or Curity support and professional services. They will use the import facility from developer tools or a 3rd party tool, to load the trace and inspect the HTTP messages. This should enable them to resolve the issue in a timely manner, typically by correcting the configuration.

## Sanitation

The captured browser trace can contain sensitive information that you should sanitized before sharing the file with anyone. Typical data could include tokens, cookies, secrets and Personally Identifiable Information (PII).

There are several tools available that can automate the process of sanitizing the file. Google has an open source [HAR Sanitizer](https://github.com/google/har-sanitizer) for example. Use these tools at your own risk.

You can also manually sanitize the file. Open the file in a text editor of choice and search for the term that needs to be redacted. Make sure to make the search case insensitive so that you for example catch the term `Authorization` when searching for `authorization`. A list of key words to search for where the values can potentially contain sensitive data is outlined below. Note that other attributes could also contain sensitive information depending on what data you have captured in the trace.

-   authorization
-   password
-   token
-   access\_token
-   id\_token
-   refresh\_token
-   code
-   code\_verifier
-   bearer
-   passkey
-   signature
-   pem
-   key
-   state
-   email

Use these key words to search the captured trace and replace the value that these keys hold with something that is noting you have redacted the value, e.g. `--- redacted ---`.

## Conclusion

Browser trace logs are sometimes a necessity in troubleshooting web applications. The most common browsers used today support capturing these detailed logs and also support exporting them in the [HTTP Archive (HAR)](https://en.wikipedia.org/wiki/HAR_(file_format)) format. The Curity support or Professional Services team might request this type of log when helping customers in troubleshooting specific issues.
