Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6350949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:54:29+00:00 2026-05-24T21:54:29+00:00

All! I’d like to secure my application with security system together. Below security.yml file

  • 0

All!
I’d like to secure my application with security system together.
Below security.yml file

security:
  encoders:
    Symfony\Component\Security\Core\User\User: plaintext

  role_hierarchy:
    ROLE_ADMIN:       ROLE_USER
    ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]

  providers:
    in_memory:
      users:
        user:  { password: userpass, roles: [ 'ROLE_USER' ] }
        admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] }

  firewalls:
    dev:
      pattern:  ^/(_(profiler|wdt)|css|images|js)/
      security: false

    login:
      pattern:  ^/{_locale}/demo/secured/login$
      security: false

    secured_area:
      pattern:    ^/{_locale}/demo/secured/
      form_login:
        check_path: /{_locale}/demo/secured/login_check
          login_path: /{_locale}/demo/secured/login
        logout:
          path:   /{_locale}/demo/secured/logout
          target: /{_locale}/demo/

The problem:

logout->target return desn’t work.
Could anybody help me ?

PS: Any examples would be appreciated!

Thx

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T21:54:31+00:00Added an answer on May 24, 2026 at 9:54 pm

    Just make sure you define routes for them all that do use the locale variable and security seems to pick it up automatically. No need to have the locale accounted for in the security config.

    Here’s an example from my project.

    Excerpt from security.yml:

        login:
            pattern:  /(game|admin)/login$
            security: false
    
        admin:
            pattern:    /admin/
            form_login:
                check_path: /admin/login_check
                login_path: _admin_login
            logout:
                path:   _admin_logout
                target: _home
    
        game:
            pattern:    /game/
            form_login:
                check_path: /game/login_check
                login_path: _game_login
            logout:
                path:  _game_logout
                target: _home
    

    Excerpt from routing.yml:

    BrowserMMOSecurityBundle:
        resource: "@BrowserMMOSecurityBundle/Controller/"
        type:     annotation
        prefix:   /{_locale}/
        defaults: { _locale: en }
        requirements:
            _locale: en|fr
    
    _game_login_check:
        pattern:   /game/login_check
    
    _admin_login_check:
        pattern:   /admin/login_check
    
    _admin_logout:
        pattern:   /{_locale}/admin/logout
        requirements:
            _locale: en|fr
    
    _game_logout:
        pattern:   /{_locale}/game/logout
        requirements:
            _locale: en|fr
    

    The above config works for me. It’s also worth noting that the _admin_login and _game_login routes are defined in annotations on my SecurityController class.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All too often I want a WPF slider that behaves like the System.Windows.Forms.TrackBar of
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
All throughout an application wherever error messages (or other user messages) are used I
All, See the code below: function menu() { this.menuitem=[]; this.submenu=[]; this.menuitem[0] = $('div#sivname1'); this.menuitem[1]
All time am getting below error message in groovy... Could not understand whats causing
All the code/commands below are part of a PHP script that processes images from
All of a sudden my form link looks like this: <form action=/r.ashx/Models.Module_ContactUs?action=Submit&amp;controller=Contact id=contactUsForm method=post>
All, I'm trying to use the jQuery Form Validator (http://docs.jquery.com/Plugins/Validation). However I'd like to
All the articles I've found via google are either obsolete or contradict one another.
All the recent VisualSVN Server posts made me want to check it out. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.