How to call extra parameter from login form into CustomAuthenticationProvider
<p>I seen other post about this but still doesnt find appropriate answer.</p>

<p>My form submitted have three parameter instead of two.</p>

<p>Here my CustomAuthenticationProvider:</p>

<pre><code>@Component
public class CustomAuthenticationProvider implements AuthenticationProvider {
private static final Logger logger = LoggerFactory.getLogger(CustomAuthenticationProvider.class);

@Override
public Authentication authenticate(Authentication auth) throws AuthenticationException {
    String userName = auth.getName().trim();
    String password = auth.getCredentials().toString().trim();
    String companyName ;


    if (userName.equals("admin") &amp;&amp; password.equals("123456")) {
        List&lt;GrantedAuthority&gt; grantedAuths = new ArrayList&lt;&gt;();
        grantedAuths.add(new SimpleGrantedAuthority("ROLE_ADMIN"));
        Authentication upat = new UsernamePasswordAuthenticationToken(userName, password, grantedAuths);
        logger.info("{}:{}",userName,grantedAuths);
        return upat;

    } else {
        return null;
    }
}

@Override
public boolean supports(Class&lt;?&gt; auth) {
    return (UsernamePasswordAuthenticationToken.class.isAssignableFrom(auth));
}
</code></pre>

<p>I want to get extra parameter from login form to authenticate the <code>companyName</code> in <code>CustomAuthenticationProvider</code></p>

<p>How can I get the parameter from the login form?</p>