所以我有這個(gè)新網(wǎng)站,我只是用 PHP/Symfony4 制作的,但是我在使身份驗(yàn)證登錄表單與文件中in_memory提供的用戶(hù)一起正常工作時(shí)遇到了麻煩security.yml。登錄表單沒(méi)有讓我登錄。我所做的我在templates/security/login.html.twig文件 HTML 表單中提供登錄名和密碼。我提供與存儲(chǔ)在security.yml.發(fā)生什么了提交登錄表單后,加載的下一個(gè)頁(yè)面再次是登錄表單,沒(méi)有任何錯(cuò)誤消息。應(yīng)該發(fā)生什么我期待被重定向到/adminURL。config/packages/security.ymlsecurity: encoders: Symfony\Component\Security\Core\User\User: bcrypt providers: access_users: memory: users: steve: password: '$2y$13$JacnEcmt6fdm2.5mt1cKIe8h8c5nMXqxQq29J2QxiK5TDKgn0DthK' roles: 'ROLE_SUPER_ADMIN' firewalls: dev: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false main: switch_user: true provider: access_users pattern: /admin$ form_login: login_path: security_login check_path: security_login csrf_token_generator: security.csrf.token_manager access_control: - { path: ^/admin$, role: ROLE_SUPER_ADMIN } - { path: ^/login$, roles: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/, role: IS_AUTHENTICATED_ANONYMOUSLY }src/Controller\SecurityController.php<?phpnamespace App\Controller;use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;use Symfony\Component\Routing\Annotation\Route;use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;我還深入研究了,src/Security/LoginFormAuthenticator.php但在我看來(lái),這與數(shù)據(jù)庫(kù)存儲(chǔ)的用戶(hù)管理更相關(guān)。那么這甚至可以讓表單登錄和in_memory用戶(hù)一起工作嗎?我該怎么做?
如何讓 in_memory security.yml 提供的用戶(hù)使用 Symfony4.3
慕的地6264312
2021-10-22 12:57:23