重定向防火墙symfony 4

时间:2019-05-30 17:29:55

标签: symfony google-plus symfony4 firewall

您好,我有一个登录操作问题,有关更多说明,请使用2按钮:

  • 登录(使用电子邮件和密码)
  • 使用gmail帐户登录 当我单击“写电子邮件和密码”时,单击“登录”将我重定向以选择一个Gmail帐户,但我想正常使用电子邮件和密码登录

这是security.yaml文件

security.yaml

encoders:
    App\Entity\User:
        algorithm: argon2i

# https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
providers:
    # used to reload user from session & other features (e.g. switch_user)
    app_user_provider:
        entity:
            class: App\Entity\User
            property: email
firewalls:
    dev:
        pattern: ^/(_(profiler|wdt)|css|images|js)/
        security: false   
    main:
        anonymous: ~
        guard:
            authenticators:
                - App\Security\GoogleAuthenticator
                - App\Security\LoginFormAuthenticator
            entry_point: App\Security\LoginFormAuthenticator

        logout: 
            path: logout 
        # activate different ways to authenticate

        # http_basic: true
        # https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate

        # form_login: true
        # https://symfony.com/doc/current/security/form_login_setup.html

# Easy way to control access for large sections of your site
# Note: Only the *first* access control that matches will be used
access_control:
      - { path: ^/admin, roles: ROLE_ADMIN }
      - { path: ^/profile, roles: ROLE_USER }
      - { path: ^/car, roles: ROLE_USER }

如何解决此问题

0 个答案:

没有答案