symfony - 1 application with 2 login security -




i have symfony 3 application. there 1 part /api , 1 /back (administration)

the /api use lexikjwtauthentication , /back fosuserbundle.

with actual security, have error when go /back.

a token not found in tokenstorage. 

i think, app try read bearer token.

how can use fosuserbundle security routes /back ?

my security.yml

security:     encoders:         fos\userbundle\model\userinterface: bcrypt  ...     providers:         fos_userbundle:             id: fos_user.user_provider.username_email ...     role_hierarchy:         role_admin:       role_user         role_super_admin: role_admin      providers:         fos_userbundle:             id: fos_user.user_provider.username_email      firewalls:         # disables authentication assets , profiler, adapt according needs         dev:             pattern: ^/(_(profiler|wdt)|css|images|js)/             security: false          login:             pattern:  ^/api/login             stateless: true             anonymous: true             form_login:                 check_path:               /api/login_check                 success_handler:          lexik_jwt_authentication.handler.authentication_success                 failure_handler:          lexik_jwt_authentication.handler.authentication_failure                 require_previous_session: false          api:             pattern:   ^/api             stateless: true             guard:                 authenticators:                     - api.jwt_authenticator             logout:       true             anonymous:    true          back:           pattern:   ^/back           form_login:             provider: fos_userbundle             login_path: /back/login             check_path: /back/login_check             csrf_token_generator: security.csrf.token_manager 

routing.yml

fos_user_security_login:     defaults: { _controller: "fosuserbundle:security:login" }     path: /back/login  fos_user_security_check:     defaults: { _controller: "fosuserbundle:security:check" }     path: /back/login_check  fos_user_security_logout:     defaults: { _controller: "fosuserbundle:security:logout" }     path: /back/logout 

config.yml

fos_user:     db_driver: orm     firewall_name:     user_class: appbundle\entity\user     from_email:         address: "test@test.test"         sender_name: "test@test.test" 

i think forgot add provider , csrf_token_generator (symfony doc) :

back:       pattern:   ^/back       form_login:         provider: fos_userbundle         csrf_token_generator: security.csrf.token_manager         login_path: /back/login         check_path: /back/login_check 

and check if fosuser routes behind /back routes (cf symfony doc )





wiki

Comments

Popular posts from this blog

elasticsearch - what is the equivalent data type for geo_point in hibernate search? -

Jenkins: find build number for git commit -

firebase - How to wait value in Ionic 2 -