# Form fill

The reverse proxy can send a form post to a specified URL. Use this when a legacy web application supports automatic sign-in through an HTTP form submission.

Configure form fill on a specific URI pattern in the content provider. The pattern identifies the request that should trigger the form post.

In most cases, the URI pattern matches the exact URL that receives the real form submission. To find it, inspect the login page source and check the `action` attribute on the `<form>` tag. You can also capture the request with tools such as **Fiddler** or **Wireshark**.

After you identify the target URI and required fields, create metadata for the URI pattern. Select **Form Post Processor** as the metadata type. Then add the fields that the application expects.

Field values can be:

* Static values
* Current username or password
* Groovy scripts

{% stepper %}
{% step %}

#### Open the content provider

Sign in to **Webconsole** and open **Content Providers**.

![](/files/92511c531fd2066c3159704286cc3ee39a08aca8)

Select the `edit` icon for the content provider you want to update.

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

{% step %}

#### Configure 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 form post metadata

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

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

Enter a metadata name. Then open `Metadata Type` and select `Form Post Processor`.

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

{% step %}

#### Set the form post content type

Use either `application/x-www-form-urlencoded` or `multipart/form-data`.

In the `Content-Type` field, enter one of these values:

* `application/x-www-form-urlencoded`
* `multipart/form-data`
* `urlencoded`
* `form-data`

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

{% step %}

#### Add form fields

The required fields depend on the application. Check the HTML source for the `<form>` fields or capture the request with a network tool.

<figure><img src="/files/4c8983bf7197381ac8d557f51b6bf77d081adf77" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/4d2dc78a29137123d4542396857d804dcf5a54fe" alt=""><figcaption></figcaption></figure>

After you add the fields, the form fill metadata looks like this.

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

When the browser hits this URI, OpenIAM `rProxy` changes the **GET** request to a **POST** request, fills the configured fields, and sends the form post to the backend. Make sure the form post `Meta Data` content type is set to `urlencoded` or `multipart/form-data`.
{% endstep %}
{% endstepper %}

{% hint style="warning" %}
Some applications use CAPTCHA or browser-based protections that block external form submission. Form fill does not work for those applications.
{% endhint %}

{% hint style="info" %}
Some applications also include hidden HTML fields that must be submitted with the form. Common examples in .NET applications include `__VIEWSTATE`, `__VIEWSTATEGENERATOR`, `__EVENTVALIDATION`, `__EVENTTARGET`, and `__EVENTARGUMENT`. You can fetch and submit these values, but the setup can be more complex.
{% endhint %}


---

# 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/form-fill.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.
