English 中文(简体)
伪造的假象
原标题:Losing authenticated token in symfony

我在地名上的认证方面存在问题。Login_checkcreditatesuser in database but after redirection to /dash上板, which should be for accreditationateduser only, it original symfony is loss my token withuser and role, supplemented byony one and redirects me to signin page.

看来,在重新定向之后,我的会议似乎有点回头。

安全

security:
    encoders:
        ReboundCoreDataBundleEntityUser: 
            algorithm: sha512
            encode_as_base64: false
            iterations: 10
    providers:
        database:
            entity: 
                class: ReboundDataBundle:User
                property: email
    role_hierarchy:
            ROLE_SUPER_USER: [ROLE_USER, ROLE_ALLOWED_TO_SWITCH]
            ROLE_TEAM_MEMBER: [ROLE_SUPER_USER, ROLE_USER, ROLE_ALLOWED_TO_SWITCH]
            ROLE_OWNER: [ROLE_TEAM_MEMBER, ROLE_SUPER_USER, ROLE_USER, ROLE_ALLOWED_TO_SWITCH]
    firewalls:
        dev:
            pattern:  ^/(_(profiler|wdt)|css|images|js)/
            security: false
            anonymous: true
        secured_area:
            pattern:    ^/
            anonymous:  ~
            form_login:
                login_path:  /login
                check_path:  /login_check
                always_use_default_target_path: true
                default_target_path: /dashboard
                username_parameter: login_form[email]
                password_parameter: login_form[password]
            logout:
                path:   /logout
                target: /
    access_control:
        - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/dashboard, roles: ROLE_USER }

这是由用户/密码生成的UNST生成的标志的一部分。

[2013-07-04 20:07:54] event.DEBUG: Notified event "kernel.request" to listener "SymfonyComponentHttpKernelEventListenerProfilerListener::onKernelRequest". [] []
[2013-07-04 20:07:54] event.DEBUG: Notified event "kernel.request" to listener "SymfonyBundleFrameworkBundleEventListenerSessionListener::onKernelRequest". [] []
[2013-07-04 20:07:54] event.DEBUG: Notified event "kernel.request" to listener "SymfonyComponentHttpKernelEventListenerFragmentListener::onKernelRequest". [] []
[2013-07-04 20:07:54] event.DEBUG: Notified event "kernel.request" to listener "SymfonyComponentHttpKernelEventListenerRouterListener::onKernelRequest". [] []
[2013-07-04 20:07:54] request.INFO: Matched route "rebound_logic_login_check" (parameters: "_route": "rebound_logic_login_check") [] []
[2013-07-04 20:07:54] event.DEBUG: Notified event "kernel.request" to listener "SymfonyComponentHttpKernelEventListenerLocaleListener::onKernelRequest". [] []
[2013-07-04 20:07:54] event.DEBUG: Notified event "kernel.request" to listener "SymfonyComponentSecurityHttpFirewall::onKernelRequest". [] []
[2013-07-04 20:07:54] doctrine.DEBUG: SELECT t0.id AS id1, t0.name AS name2, t0.email AS email3, t0.password AS password4, t0.salt AS salt5, t0.image_file_name AS image_file_name6, t0.position AS position7, t0.timezone_id AS timezone_id8, t0.timezone_id AS timezone_id9 FROM user t0 WHERE t0.email = ? LIMIT 1 ["[email protected]"] []
[2013-07-04 20:07:54] doctrine.DEBUG: SELECT t0.id AS id1, t0.name AS name2, t0.alias AS alias3 FROM role t0 INNER JOIN user_role ON t0.id = user_role.role_id WHERE user_role.user_id = ? [1] []
[2013-07-04 20:07:54] security.INFO: User "[email protected]" has been authenticated successfully [] []
[2013-07-04 20:07:54] event.DEBUG: Listener "SymfonyComponentSecurityHttpFirewall::onKernelRequest" stopped propagation of the event "kernel.request". [] []
[2013-07-04 20:07:54] event.DEBUG: Listener "SymfonyBundleAsseticBundleEventListenerRequestListener::onKernelRequest" was not called for event "kernel.request". [] []
[2013-07-04 20:07:54] event.DEBUG: Listener "SymfonyComponentHttpKernelEventListenerErrorsLoggerListener::injectLogger" was not called for event "kernel.request". [] []
[2013-07-04 20:07:54] event.DEBUG: Listener "SymfonyComponentHttpKernelEventListenerErrorsLoggerListener::injectLogger" was not called for event "kernel.request". [] []
[2013-07-04 20:07:54] event.DEBUG: Notified event "kernel.response" to listener "SymfonyComponentSecurityHttpFirewallContextListener::onKernelResponse". [] []
[2013-07-04 20:07:54] security.DEBUG: Write SecurityContext in the session [] []
[2013-07-04 20:07:54] event.DEBUG: Notified event "kernel.response" to listener "SymfonyBridgeMonologHandlerFirePHPHandler::onKernelResponse". [] []
[2013-07-04 20:07:54] event.DEBUG: Notified event "kernel.response" to listener "SymfonyBridgeMonologHandlerChromePhpHandler::onKernelResponse". [] []
[2013-07-04 20:07:54] event.DEBUG: Notified event "kernel.response" to listener "SymfonyComponentHttpKernelEventListenerResponseListener::onKernelResponse". [] []
[2013-07-04 20:07:54] event.DEBUG: Notified event "kernel.response" to listener "SymfonyComponentSecurityHttpRememberMeResponseListener::onKernelResponse". [] []
[2013-07-04 20:07:54] event.DEBUG: Notified event "kernel.response" to listener "SensioBundleFrameworkExtraBundleEventListenerCacheListener::onKernelResponse". [] []
[2013-07-04 20:07:54] event.DEBUG: Notified event "kernel.response" to listener "SymfonyComponentHttpKernelEventListenerProfilerListener::onKernelResponse". [] []
[2013-07-04 20:07:54] event.DEBUG: Notified event "kernel.response" to listener "SymfonyBundleWebProfilerBundleEventListenerWebDebugToolbarListener::onKernelResponse". [] []
[2013-07-04 20:07:54] event.DEBUG: Notified event "kernel.response" to listener "SymfonyComponentHttpKernelEventListenerStreamedResponseListener::onKernelResponse". [] []
[2013-07-04 20:07:54] event.DEBUG: Notified event "kernel.terminate" to listener "SymfonyBundleSwiftmailerBundleEventListenerEmailSenderListener::onKernelTerminate". [] []
[2013-07-04 20:07:55] event.DEBUG: Notified event "kernel.request" to listener "SymfonyComponentHttpKernelEventListenerProfilerListener::onKernelRequest". [] []
[2013-07-04 20:07:55] event.DEBUG: Notified event "kernel.request" to listener "SymfonyBundleFrameworkBundleEventListenerSessionListener::onKernelRequest". [] []
[2013-07-04 20:07:55] event.DEBUG: Notified event "kernel.request" to listener "SymfonyComponentHttpKernelEventListenerFragmentListener::onKernelRequest". [] []
[2013-07-04 20:07:55] event.DEBUG: Notified event "kernel.request" to listener "SymfonyComponentHttpKernelEventListenerRouterListener::onKernelRequest". [] []
[2013-07-04 20:07:55] request.INFO: Matched route "_wdt" (parameters: "_controller": "web_profiler.controller.profiler:toolbarAction", "token": "147cfa", "_route": "_wdt") [] []
[2013-07-04 20:07:55] event.DEBUG: Notified event "kernel.request" to listener "SymfonyComponentHttpKernelEventListenerLocaleListener::onKernelRequest". [] []
[2013-07-04 20:07:55] event.DEBUG: Notified event "kernel.request" to listener "SymfonyComponentSecurityHttpFirewall::onKernelRequest". [] []
[2013-07-04 20:07:55] event.DEBUG: Notified event "kernel.request" to listener "SymfonyBundleAsseticBundleEventListenerRequestListener::onKernelRequest". [] []
[2013-07-04 20:07:55] event.DEBUG: Notified event "kernel.request" to listener "SymfonyComponentHttpKernelEventListenerErrorsLoggerListener::injectLogger". [] []
[2013-07-04 20:07:55] event.DEBUG: Notified event "kernel.request" to listener "SymfonyComponentHttpKernelEventListenerErrorsLoggerListener::injectLogger". [] []
[2013-07-04 20:07:55] event.DEBUG: Notified event "kernel.controller" to listener "SymfonyBundleFrameworkBundleDataCollectorRouterDataCollector::onKernelController". [] []
[2013-07-04 20:07:55] event.DEBUG: Notified event "kernel.controller" to listener "SymfonyComponentHttpKernelDataCollectorRequestDataCollector::onKernelController". [] []
[2013-07-04 20:07:55] event.DEBUG: Notified event "kernel.controller" to listener "SensioBundleFrameworkExtraBundleEventListenerControllerListener::onKernelController". [] []
[2013-07-04 20:07:55] event.DEBUG: Notified event "kernel.controller" to listener "SensioBundleFrameworkExtraBundleEventListenerParamConverterListener::onKernelController". [] []
[2013-07-04 20:07:55] event.DEBUG: Notified event "kernel.controller" to listener "SensioBundleFrameworkExtraBundleEventListenerTemplateListener::onKernelController". [] []
[2013-07-04 20:07:55] event.DEBUG: Notified event "kernel.response" to listener "SymfonyBridgeMonologHandlerFirePHPHandler::onKernelResponse". [] []
[2013-07-04 20:07:55] event.DEBUG: Notified event "kernel.response" to listener "SymfonyBridgeMonologHandlerChromePhpHandler::onKernelResponse". [] []
[2013-07-04 20:07:55] event.DEBUG: Notified event "kernel.response" to listener "SymfonyComponentHttpKernelEventListenerResponseListener::onKernelResponse". [] []
[2013-07-04 20:07:55] event.DEBUG: Notified event "kernel.response" to listener "SymfonyComponentSecurityHttpRememberMeResponseListener::onKernelResponse". [] []
[2013-07-04 20:07:55] event.DEBUG: Notified event "kernel.response" to listener "SensioBundleFrameworkExtraBundleEventListenerCacheListener::onKernelResponse". [] []
[2013-07-04 20:07:55] event.DEBUG: Notified event "kernel.response" to listener "SymfonyComponentHttpKernelEventListenerProfilerListener::onKernelResponse". [] []
[2013-07-04 20:07:55] event.DEBUG: Notified event "kernel.response" to listener "SymfonyBundleWebProfilerBundleEventListenerWebDebugToolbarListener::onKernelResponse". [] []
[2013-07-04 20:07:55] event.DEBUG: Notified event "kernel.response" to listener "SymfonyComponentHttpKernelEventListenerStreamedResponseListener::onKernelResponse". [] []
[2013-07-04 20:07:55] event.DEBUG: Notified event "kernel.terminate" to listener "SymfonyBundleSwiftmailerBundleEventListenerEmailSenderListener::onKernelTerminate". [] []

这是在试图进入仪表板时产生的记录的一部分。

[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.request" to listener "SymfonyComponentHttpKernelEventListenerProfilerListener::onKernelRequest". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.request" to listener "SymfonyBundleFrameworkBundleEventListenerSessionListener::onKernelRequest". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.request" to listener "SymfonyComponentHttpKernelEventListenerFragmentListener::onKernelRequest". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.request" to listener "SymfonyComponentHttpKernelEventListenerRouterListener::onKernelRequest". [] []
[2013-07-04 20:08:53] request.INFO: Matched route "rebound_logic_dashboard" (parameters: "_controller": "ReboundCoreLogicBundleControllerDashboardController::indexAction", "_route": "rebound_logic_dashboard") [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.request" to listener "SymfonyComponentHttpKernelEventListenerLocaleListener::onKernelRequest". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.request" to listener "SymfonyComponentSecurityHttpFirewall::onKernelRequest". [] []
[2013-07-04 20:08:53] security.DEBUG: Read SecurityContext from the session [] []
[2013-07-04 20:08:53] security.INFO: Populated SecurityContext with an anonymous Token [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.exception" to listener "SymfonyComponentSecurityHttpFirewallExceptionListener::onKernelException". [] []
[2013-07-04 20:08:53] security.DEBUG: Access is denied (user is not fully authenticated) by "F:Programswampwww
eboundvendorsymfonysymfonysrcSymfonyComponentSecurityHttpFirewallAccessListener.php" at line 73; redirecting to authentication entry point [] []
[2013-07-04 20:08:53] security.DEBUG: Calling Authentication entry point [] []
[2013-07-04 20:08:53] event.DEBUG: Listener "SymfonyComponentSecurityHttpFirewallExceptionListener::onKernelException" stopped propagation of the event "kernel.exception". [] []
[2013-07-04 20:08:53] event.DEBUG: Listener "SymfonyComponentHttpKernelEventListenerProfilerListener::onKernelException" was not called for event "kernel.exception". [] []
[2013-07-04 20:08:53] event.DEBUG: Listener "SymfonyComponentHttpKernelEventListenerExceptionListener::onKernelException" was not called for event "kernel.exception". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.response" to listener "SymfonyComponentSecurityHttpFirewallContextListener::onKernelResponse". [] []
[2013-07-04 20:08:53] security.DEBUG: Write SecurityContext in the session [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.response" to listener "SymfonyBridgeMonologHandlerFirePHPHandler::onKernelResponse". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.response" to listener "SymfonyBridgeMonologHandlerChromePhpHandler::onKernelResponse". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.response" to listener "SymfonyComponentHttpKernelEventListenerResponseListener::onKernelResponse". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.response" to listener "SymfonyComponentSecurityHttpRememberMeResponseListener::onKernelResponse". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.response" to listener "SensioBundleFrameworkExtraBundleEventListenerCacheListener::onKernelResponse". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.response" to listener "SymfonyComponentHttpKernelEventListenerProfilerListener::onKernelResponse". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.response" to listener "SymfonyBundleWebProfilerBundleEventListenerWebDebugToolbarListener::onKernelResponse". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.response" to listener "SymfonyComponentHttpKernelEventListenerStreamedResponseListener::onKernelResponse". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.terminate" to listener "SymfonyBundleSwiftmailerBundleEventListenerEmailSenderListener::onKernelTerminate". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.request" to listener "SymfonyComponentHttpKernelEventListenerProfilerListener::onKernelRequest". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.request" to listener "SymfonyBundleFrameworkBundleEventListenerSessionListener::onKernelRequest". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.request" to listener "SymfonyComponentHttpKernelEventListenerFragmentListener::onKernelRequest". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.request" to listener "SymfonyComponentHttpKernelEventListenerRouterListener::onKernelRequest". [] []
[2013-07-04 20:08:53] request.INFO: Matched route "_wdt" (parameters: "_controller": "web_profiler.controller.profiler:toolbarAction", "token": "b10b3b", "_route": "_wdt") [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.request" to listener "SymfonyComponentHttpKernelEventListenerLocaleListener::onKernelRequest". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.request" to listener "SymfonyComponentSecurityHttpFirewall::onKernelRequest". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.request" to listener "SymfonyBundleAsseticBundleEventListenerRequestListener::onKernelRequest". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.request" to listener "SymfonyComponentHttpKernelEventListenerErrorsLoggerListener::injectLogger". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.request" to listener "SymfonyComponentHttpKernelEventListenerErrorsLoggerListener::injectLogger". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.controller" to listener "SymfonyBundleFrameworkBundleDataCollectorRouterDataCollector::onKernelController". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.controller" to listener "SymfonyComponentHttpKernelDataCollectorRequestDataCollector::onKernelController". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.controller" to listener "SensioBundleFrameworkExtraBundleEventListenerControllerListener::onKernelController". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.controller" to listener "SensioBundleFrameworkExtraBundleEventListenerParamConverterListener::onKernelController". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.controller" to listener "SensioBundleFrameworkExtraBundleEventListenerTemplateListener::onKernelController". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.response" to listener "SymfonyBridgeMonologHandlerFirePHPHandler::onKernelResponse". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.response" to listener "SymfonyBridgeMonologHandlerChromePhpHandler::onKernelResponse". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.response" to listener "SymfonyComponentHttpKernelEventListenerResponseListener::onKernelResponse". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.response" to listener "SymfonyComponentSecurityHttpRememberMeResponseListener::onKernelResponse". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.response" to listener "SensioBundleFrameworkExtraBundleEventListenerCacheListener::onKernelResponse". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.response" to listener "SymfonyComponentHttpKernelEventListenerProfilerListener::onKernelResponse". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.response" to listener "SymfonyBundleWebProfilerBundleEventListenerWebDebugToolbarListener::onKernelResponse". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.response" to listener "SymfonyComponentHttpKernelEventListenerStreamedResponseListener::onKernelResponse". [] []
[2013-07-04 20:08:53] event.DEBUG: Notified event "kernel.terminate" to listener "SymfonyBundleSwiftmailerBundleEventListenerEmailSenderListener::onKernelTerminate". [] []

请帮助,我只花10个小时试图解决这一问题:

问题回答

我有这个问题,就我而言,它来自可扩展的界面实施。

I followed the example in the doc but when I quit the Serializable implementation, letting Symfony doing by itself, it started to work like a charm.





相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Remotely authenticating client Windows user on demand

Suppose I am writing a server for a particular network protocol. If I know that the client is running on a Windows machine, is it possible for my server to authenticate the Windows user that owns the ...

Role/Permission based forms authorizing/authentication?

While looking into forms authorizing/authentication, I found that it is possible to do role based authorizing by adding an array of roles to a FormsAuthenticationTicket. That way I can write User....

热门标签