Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/292.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Symfony2。无法转发到登录\您的签入_Php_Security_Symfony - Fatal编程技术网

Php Symfony2。无法转发到登录\您的签入

Php Symfony2。无法转发到登录\您的签入,php,security,symfony,Php,Security,Symfony,我想在用户注册后对其进行身份验证 因此,注册行动是: 问题是Symfony安全系统不接受此重定向,而是直接执行securityCheckAction,该操作自然为空 重定向的工作方式如下: return $this->redirect($this->generateUrl('mobile_login_check') . "?_username=" . $customer->getEmail() . "&_password=pass"); 转发更可取,因为我想使

我想在用户注册后对其进行身份验证

因此,注册行动是:

问题是Symfony安全系统不接受此重定向,而是直接执行securityCheckAction,该操作自然为空

重定向的工作方式如下:

    return $this->redirect($this->generateUrl('mobile_login_check') . "?_username=" . $customer->getEmail() . "&_password=pass");
转发更可取,因为我想使用POST请求进行注册操作和安全检查操作

有什么想法吗

在另一方面,也许它会更好地认证用户自己?就像这里描述的:


您的意见是什么?

尝试使用POST执行重定向不是一个好主意。原因如下:

最好的方法是创建令牌并发出登录事件:

看看FOSUserBundle。它提供了所有这些功能和更多功能$此->获取'security.context'->setToken$token;。这是简单而有效的。
    return $this->redirect($this->generateUrl('mobile_login_check') . "?_username=" . $customer->getEmail() . "&_password=pass");