rest-assured/src/main/java/io/restassured/authentication/FormAuthConfig.java
public FormAuthConfig withAdditionalField(String fieldName) {
        notNull(fieldName, "Additional field name");
        List<String> list = new ArrayList<String>(additionalInputFieldNames);
        list.add(fieldName);
        return new FormAuthConfig(formAction, userInputTagName, passwordInputTagName, logDetail, logConfig, csrfFieldName, autoDetectCsrfFieldName, sendCsrfTokenAsFormParam, list);
    }
public FormAuthConfig withAdditionalField(String fieldName) {
        notNull(fieldName, "Additional field name");
        List<String> list = new ArrayList<String>(additionalInputFieldNames);
        list.add(fieldName);
        return new FormAuthConfig(formAction, userInputTagName, passwordInputTagName, logDetail, logConfig, csrfFieldName, autoDetectCsrfFieldName, sendCsrfTokenAsFormParam, list);
    }
public FormAuthConfig withAdditionalField ( String fieldName ) { notNull ( fieldName , "Additional field name" ) ; List < String > list = new ArrayList < String > ( additionalInputFieldNames ) ; list . add ( fieldName ) ; return new FormAuthConfig ( formAction , userInputTagName , passwordInputTagName , logDetail , logConfig , csrfFieldName , autoDetectCsrfFieldName , sendCsrfTokenAsFormParam , list ) ; }
Include additional field when using form authentication by including input field value with the specified name.
For example if the login page looks like this:
<pre>
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Login&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form action=&quot;j_spring_security_check_with_csrf&quot; method=&quot;POST&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;User:&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;j_username&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Password:&lt;/td&gt;
&lt;td&gt;&lt;input type=&quot;password&quot; name=&quot;j_password&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;input name=&quot;submit&quot; type=&quot;submit&quot;/&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;input type=&quot;hidden&quot; name=&quot;something&quot; value=&quot;8adf2ea1-b246-40aa-8e13-a85fb7914341&quot;/&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
and you'd like to include the field named <code>something</code> as an additional form parameter in the request you can do like this:

<pre>
given().auth().form(..., new FormAuthConfig(..).withAdditionalField("something"). ..
</pre>
and then REST Assured will send the form parameter <code>something=8adf2ea1-b246-40aa-8e13-a85fb7914341</code>

<p/>
<b>Important:</b> When including an additional field without specifying a value then REST Assured <b>must always</b> make an additional request to the server in order to
be able to figure out the field value. This will slow down the tests.

@param fieldName The first field name to include
@return A new FormAuthConfig instance.
Include additional field when using form authentication by including input field value with the specified name . For example if the login page looks like this : <pre > &lt ; html&gt ; &lt ; head&gt ; &lt ; title&gt ; Login&lt ; / title&gt ; &lt ; / head&gt ; &lt ; body&gt ; &lt ; form action = &quot ; j_spring_security_check_with_csrf&quot ; method = &quot ; POST&quot ; &gt ; &lt ; table&gt ; &lt ; tr&gt ; &lt ; td&gt ; User : &amp ; nbsp ; &lt ; / td&gt ; &lt ; td&gt ; &lt ; input type = &quot ; text&quot ; name = &quot ; j_username&quot ; &gt ; &lt ; / td&gt ; &lt ; / tr&gt ; &lt ; tr&gt ; &lt ; td&gt ; Password : &lt ; / td&gt ; &lt ; td&gt ; &lt ; input type = &quot ; password&quot ; name = &quot ; j_password&quot ; &gt ; &lt ; / td&gt ; &lt ; / tr&gt ; &lt ; tr&gt ; &lt ; td colspan = &quot ; 2&quot ; &gt ; &lt ; input name = &quot ; submit&quot ; type = &quot ; submit&quot ; / &gt ; &lt ; / td&gt ; &lt ; / tr&gt ; &lt ; / table&gt ; &lt ; input type = &quot ; hidden&quot ; name = &quot ; something&quot ; value = &quot ; 8adf2ea1 - b246 - 40aa - 8e13 - a85fb7914341&quot ; / &gt ; &lt ; / form&gt ; &lt ; / body&gt ; &lt ; / html&gt ; < / pre > and you d like to include the field named <code > something< / code > as an additional form parameter in the request you can do like this :