Security/Firewall/LdapFormLoginListener.php
protected function addDomainToTokenIfPresent(Request $request, UsernamePasswordToken $token)
    {
        if ($this->options['post_only'] && $request->request->has($this->options['domain_parameter'])) {
            $token->setAttribute(
                'ldap_domain',
                trim($this->getParameterFromBag($request->request, $this->options['domain_parameter']))
            );
        } elseif ($domain = trim($this->getParameterFromRequest($request, $this->options['domain_parameter']))) {
            $token->setAttribute('ldap_domain', $domain);
        }
    }
protected function addDomainToTokenIfPresent(Request $request, UsernamePasswordToken $token)
    {
        if ($this->options['post_only'] && $request->request->has($this->options['domain_parameter'])) {
            $token->setAttribute(
                'ldap_domain',
                trim($this->getParameterFromBag($request->request, $this->options['domain_parameter']))
            );
        } elseif ($domain = trim($this->getParameterFromRequest($request, $this->options['domain_parameter']))) {
            $token->setAttribute('ldap_domain', $domain);
        }
    }
Add the domain name for the login request to the token if specified.

@param Request $request
@param UsernamePasswordToken $token