/home/webadmin/indiashipping/vendor/symfony/Authentication/Provider/UserAuthenticationProvider.php:72中的'bad credentials'

时间:2013-12-29 17:09:38

标签: symfony

我无法使用fosuserbundle进行登录和注册,当我点击登录按钮页面显示以后出现错误![在此输入图像说明] [1]

我的security.yml文件是

安全性:     role_hierarchy:         ROLE_ADMIN:ROLE_USER         ROLE_SUPER_ADMIN:[ROLE_USER,ROLE_ADMIN,ROLE_ALLOWED_TO_SWITCH]

providers:
    fos_userbundle:
            id: fos_user.user_manager

firewalls:
    main:
        pattern:    ^/
        form_login:
            provider: fos_userbundle
            check_path: /login_check
            login_path: /login
        logout:
            path:   /logout
            target: /
        anonymous: ~
        #http_basic:
        #    realm: "Secured Demo Area"

access_control:
    #- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https }
    #- { path: ^/_internal, roles: IS_AUTHENTICATED_ANONYMOUSLY, ip: 127.0.0.1 }

config.yml文件是

进口:      - {resource:parameters.yml}      - {resource:security.yml}

框架:     #esi:〜     翻译:〜#{fallback:%locale%}     秘密:%secret%     路由器:         资源:“%kernel.root_dir%/ config / routing.yml”         strict_requirements:〜     形式:〜     csrf_protection:〜     验证:{enable_annotations:true}     模板:         引擎:['twig']         #assets_version:SomeVersionScheme     default_locale:“%locale%”     trusted_proxies:〜     会话:〜     片段:〜     http_method_override:true

Twig配置

树枝:     debug:%kernel.debug%     strict_variables:%kernel.debug%

资产配置

assetic:     debug:%kernel.debug%     use_controller:false     捆绑:['indiaShippingMainBundle']     #java:/ usr / bin / java     过滤器:         cssrewrite:〜

    yui_css:
        jar: %kernel.root_dir%/Resources/java/yuicompressor-2.4.8.jar
    yui_js:
        jar: %kernel.root_dir%/Resources/java/yuicompressor-2.4.8.jar

学说配置

教义:     DBAL:         驱动程序:%database_driver%         主机:%database_host%         port:%database_port%         dbname:%database_name%         用户:%database_user%         密码:%database_password%         charset:UTF8         #如果使用pdo_sqlite作为数据库驱动程序,请在parameters.yml中添加路径         #例如database_path:%kernel.root_dir%/ data / data.db3         #path:%database_path%

form:
    auto_generate_proxy_classes: %kernel.debug%
    auto_mapping: true

Swiftmailer配置

swiftmailer:     运输:smtp     主持人:email-smtp.us-east-1.amazonaws.com     用户名:AKIAJZVRWLH6IRYTZS4Q     密码:AgKqNzB0xN3kWiwIJRKKnioRceUERKdUdSQ1ot9u / vp0     加密:tls     港口:587

fos_user:     db_driver:orm#其他有效值是'mongodb','couchdb'和'propel'     firewall_name:main     user_class:indiaShipping \ UserBundle \ Entity \ User     注册:         形成:             类型:indaiShi_user_registration         确认:             启用:true             FROM_EMAIL:

地址:lasri.mehdi@gmail.com

            address:        support@indiashipping.net
            sender_name:    Support - India Shipping

1 个答案:

答案 0 :(得分:0)

在security.yml文件中,首先出现缩进问题:

providers:
    fos_userbundle:
            id: fos_user.user_manager

......应该是:

providers:
    fos_userbundle:
        id: fos_user.user_manager

然后您的编码器未配置:

encoders:
    FOS\UserBundle\Model\UserInterface: sha512

我建议您使用documentation检查配置。