Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [SF2][Symfony]logowanie poprzez formularz html, problem z uwierzytelnieniem się na stronie
damianooo
post
Post #1





Grupa: Zarejestrowani
Postów: 496
Pomógł: 2
Dołączył: 15.07.2011
Skąd: Katowice

Ostrzeżenie: (0%)
-----


Przy zalogowaniu się poprzez formularz html nie mogę odczytać nazwy użytkownika:

  1. ..
  2. <p>Username: {{ app.user.username }}</p>
  3. ...


Co ciekawe WebProfiler pokazuje mi komunikat na pasku "You are not authenticated". A po kliknięciu go otwiera się Profiler z zakładką Security i wpisem "No token"
Wychodzi na to, że chyba jednak nie jestem zalogowany (IMG:style_emoticons/default/sad.gif) .

W pliku security.yml mam tak:

  1. security:
  2. encoders:
  3. My\TyperkaBundle\Entity\User:
  4. algorithm: bcrypt
  5.  
  6. role_hierarchy:
  7. ROLE_ADMIN: ROLE_USER
  8. ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
  9.  
  10.  
  11. providers:
  12. typerka_users:
  13. entity:
  14. class: MyTyperkaBundle:User
  15. property: username
  16.  
  17. firewalls:
  18. dev:
  19. pattern: ^/(_(profiler|wdt)|css|images|js)/
  20. security: false
  21.  
  22. typerka_security:
  23. pattern: ^/
  24. anonymous: ~
  25. form_login:
  26. check_path: _check_path
  27. login_path: typerka_login
  28. default_target_path: typerka_index
  29. logout:
  30. path: _logout
  31. target: typerka_index



co może być powodem braku uwierzytelnienia ?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
damianooo
post
Post #2





Grupa: Zarejestrowani
Postów: 496
Pomógł: 2
Dołączył: 15.07.2011
Skąd: Katowice

Ostrzeżenie: (0%)
-----


w logach nie widzę nic podejrzanego:
  1. [2015-10-28 17:04:23] request.INFO: Matched route "typerka_login" (parameters: "_controller": "My\TyperkaBundle\Controller\LoginController::loginAction", "_route": "typerka_login") [] []
  2. [2015-10-28 17:04:23] security.INFO: Populated SecurityContext with an anonymous Token [] []
  3. [2015-10-28 17:04:23] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ErrorsLoggerListener::injectLogg
    er". [] []
  4.  
  5. ...
  6.  
  7. [2015-10-28 17:04:23] event.DEBUG: Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::onKernel
    Controller". [] []
  8. [2015-10-28 17:04:24] event.DEBUG: Notified event "kernel.view" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::onKernel
    View". [] []
  9. [2015-10-28 17:04:24] event.DEBUG: Listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::onKernel
    View" stopped propagation of the event "kernel.view". [] []
  10. [2015-10-28 17:04:24] security.DEBUG: Write SecurityContext in the session [] []
  11.  
  12. ...
  13.  
  14. [2015-10-28 17:04:24] event.DEBUG: Notified event "kernel.terminate" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelTermin
    ate". [] []
  15. [2015-10-28 17:04:24] request.INFO: Matched route "_wdt" (parameters: "_controller": "web_profiler.controller.profiler:toolbarAction", "token": "6f197e", "_route": "_wdt") [] []
  16. [2015-10-28 17:04:24] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ErrorsLoggerListener::injectLogg
    er". [] []
  17.  
  18. ...
  19.  
  20. [2015-10-28 17:04:39] request.INFO: Matched route "_check_path" (parameters: "_route": "_check_path") [] []
  21. [2015-10-28 17:04:39] doctrine.DEBUG: SELECT t0.id AS id_1, t0.username AS username_2, t0.email AS email_3, t0.password AS password_4, t0.account_non_expired AS account_non_expired_5, t0.account_non_locked AS account_non_locked_6, t0.credentials_non_expired AS credentials_non_expired_7, t0.enabled AS enabled_8, t0.roles AS roles_9, t0.action_token AS action_token_10, t0.register_date AS register_date_11, t0.avatar AS avatar_12 FROM users t0 WHERE t0.username = ? LIMIT 1 ["adas_no"] []
  22. [2015-10-28 17:04:40] security.INFO: User "" has been authenticated successfully [] []
  23.  
  24. ...
  25.  
  26.  
  27. [2015-10-28 17:04:40] event.DEBUG: Listener "Symfony\Component\Security\Http\Firewall::onKernelRequest" stopped propagation of the event "kernel.request". [] []
  28. [2015-10-28 17:04:40] event.DEBUG: Listener "Symfony\Bundle\AsseticBundle\EventListener\RequestListener::onKernelRequest" was not called for event "kernel.request". [] []
  29. [2015-10-28 17:04:40] security.DEBUG: Write SecurityContext in the session [] []
  30.  
  31. ...
  32.  
  33. [2015-10-28 17:04:40] event.DEBUG: Notified event "kernel.terminate" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelTermin
    ate". [] []
  34. [2015-10-28 17:04:40] request.INFO: Matched route "typerka_index" (parameters: "_controller": "My\TyperkaBundle\Controller\MainController::indexAction", "_route": "typerka_index") [] []
  35. [2015-10-28 17:04:40] security.DEBUG: Read SecurityContext from the session [] []
  36. [2015-10-28 17:04:40] security.DEBUG: Reloading user from user provider. [] []
  37. [2015-10-28 17:04:40] doctrine.DEBUG: SELECT t0.id AS id_1, t0.username AS username_2, t0.email AS email_3, t0.password AS password_4, t0.account_non_expired AS account_non_expired_5, t0.account_non_locked AS account_non_locked_6, t0.credentials_non_expired AS credentials_non_expired_7, t0.enabled AS enabled_8, t0.roles AS roles_9, t0.action_token AS action_token_10, t0.register_date AS register_date_11, t0.avatar AS avatar_12 FROM users t0 WHERE t0.id = ? [1] []
  38. [2015-10-28 17:04:40] security.DEBUG: Username "" was reloaded from user provider. [] []
  39.  
  40. ...
  41.  
  42. [2015-10-28 17:04:40] event.DEBUG: Notified event "kernel.view" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::onKernel
    View". [] []
  43. [2015-10-28 17:04:40] event.DEBUG: Listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::onKernel
    View" stopped propagation of the event "kernel.view". [] []
  44. [2015-10-28 17:04:40] security.DEBUG: Write SecurityContext in the session [] []
  45.  
  46. ...
  47.  
  48. [2015-10-28 17:04:40] event.DEBUG: Notified event "kernel.terminate" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelTermin
    ate". [] []
  49. [2015-10-28 17:04:40] request.INFO: Matched route "_wdt" (parameters: "_controller": "web_profiler.controller.profiler:toolbarAction", "token": "c2dee3", "_route": "_wdt") [] []
  50. [2015-10-28 17:04:40] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ErrorsLoggerListener::injectLogg
    er". [] []


Ten post edytował damianooo 28.10.2015, 18:58:05
Go to the top of the page
+Quote Post
kpt_lucek
post
Post #3





Grupa: Zarejestrowani
Postów: 428
Pomógł: 77
Dołączył: 10.07.2011
Skąd: Warszawa

Ostrzeżenie: (0%)
-----


Cytat(damianooo @ 28.10.2015, 18:57:23 ) *
w logach nie widzę nic podejrzanego:
[html]
[2015-10-28 17:04:40] doctrine.DEBUG: SELECT t0.id AS id_1, t0.username AS username_2, t0.email AS email_3, t0.password AS password_4, t0.account_non_expired AS account_non_expired_5, t0.account_non_locked AS account_non_locked_6, t0.credentials_non_expired AS credentials_non_expired_7, t0.enabled AS enabled_8, t0.roles AS roles_9, t0.action_token AS action_token_10, t0.register_date AS register_date_11, t0.avatar AS avatar_12 FROM users t0 WHERE t0.id = ? [1] []
[2015-10-28 17:04:40] security.DEBUG: Username "" was reloaded from user provider. [] []

Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 9.10.2025 - 22:31