2012-07-31 54 views
0

我想在Symfony2內部創建一個需要用戶名/密碼和PIN碼的登錄系統。這意味着當用戶按下登錄提交按鈕時,Symfony2應該檢查用戶名,密碼和引腳。要求使用Symfony2登錄PIN

我真的不知道從哪裏開始。我有一個有效的登錄系統,使用UserInterface只使用用戶名/密碼。

任何想法?謝謝。

+3

你可以開始/current/cookbook/security/custom_authentication_provider.html);) – 2012-07-31 10:19:08

+0

這樣做的竅門!最終能夠從該教程中解決。 – 2012-07-31 11:34:16

+0

不是問題;) – 2012-07-31 11:40:43

回答

0

Follow this tutorial在聽者趕上了RedirectResponse錯誤到登錄頁面,並設置一個會話變量:閱讀[本教程(http://symfony.com/doc

$session->set(SecurityContext::AUTHENTICATION_ERROR, array('message' => 'The details entered are invalid'));