# Adding headers in request and/or response

The reverse proxy can add headers, cookies, and URL parameters during request processing. Configure these values on a content provider URI pattern.

The URI pattern works as a filter. Headers, cookies, and URL parameters are applied only to requests that match that pattern. On the URI pattern, create `Meta Data` entries with the values you want to send.

The property name is required. The property value can be a static value, the current username or password, or a Groovy script.

{% stepper %}
{% step %}

### Open the content provider

Sign in to **Webconsole** and go to **Access Control** → **Content Providers**.

![](/files/92511c531fd2066c3159704286cc3ee39a08aca8)

Open the content provider you want to update.
{% endstep %}

{% step %}

### Configure the URI pattern

Create a new **URI Pattern**.

<figure><img src="/files/0a3574d8b3a83eecf06335a2d297dcb9ef102688" alt=""><figcaption></figcaption></figure>

Or edit an existing one.

<figure><img src="/files/d4aef112b94fd9ecb7d12e8663f094675c27e25e" alt=""><figcaption></figcaption></figure>

If you create a new pattern, configure it and add it to the list.

<figure><img src="/files/bc808014017e913a1078abebd2a6fc27322e1e54" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Add a new metadata type

On the **URI Pattern** screen, scroll to `Meta Data` and click the `plus` icon.

<figure><img src="/files/48f747c8deb160ba370617e2bb00fff6343ca108" alt=""><figcaption></figcaption></figure>

In the dialog, select `Meta Data Type`.

* For headers, use `Set Header`.
* For cookies, use `Set Cookie`.

![](/files/82ae96a522582b2a683b6c937f143671bd00f702)

Add a `Meta Data Name`, then click the `plus` icon.

![](/files/29c6454b8630e0fd88913b61b4706b6905708f4c)
{% endstep %}

{% step %}

### Configure the property type

In the new dialog, enter the header or cookie name in `Property Name`. Then select the `Property Type`.

This example uses `Static Value`. You can also use `User Name`, `Password`, or `Groovy Script`.

![](/files/0afb76951dfa07159aa77b0ff0da2e59e6fcf9a9)
{% endstep %}

{% step %}

### Add `Property Value`

For `Static Value`, enter the string to send.

If you need an empty value, use the `Empty Value` property type from the previous step. For Groovy logic, use `Groovy Script`.

![](/files/3f462dcf3b797a52912772186de4195f118c5cf0)
{% endstep %}

{% step %}

### Optional: Propagate Through Proxy

You can also uncheck `Propagate Through Proxy`.

If this option is checked, which is the default, the header is added to the HTTP response and is visible in the client browser.

If it is unchecked, the header is added only to requests that the proxy sends to the backend server.

![](/files/72ef0e60d309d65c0edb610764eb8d994d231681)
{% endstep %}

{% step %}

### Optional: Propagate on Error

You can uncheck `Propagate on Error`.

If this option is unchecked, headers are added only to successful responses.

If it is checked, headers are also added to error responses such as `404` and `500`.

![](/files/ebf58a3891ee3949024aac6ab57b67540d8e20c2)
{% endstep %}

{% step %}

### Save the configuration

Click `Save`.

![](/files/3c721b9a44f41b29e15c73c5f0422ffc5916c4e8)

{% hint style="info" %}
If you need more headers or cookies, repeat the steps above.
{% endhint %}
{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-beta.openiam.com/sso-to-legacy-applications/adding-headers-in-request-and-or-response.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
