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 7985859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:40:49+00:00 2026-06-04T11:40:49+00:00

I have a symfony app that provides REST based services. I have one module

  • 0

I have a symfony app that provides REST based services. I have one module that is responsible for user login/logout/register actions called the UserBundle.

I have other bundles that provide resources once a user logs (and is provided a token hash).

Now for every resource requested, the client sends the token back which needs to be authenticated. Where exactly do I place this authentication function? I mean I know it needs to be a service that can be injected into multiple bundles but does that mean it is best I create it’s own bundle? What about additional services that I may need in future? If I create a bundle for each, then my code organization would get ugly real quick.

Any tips?

  • 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-06-04T11:40:50+00:00Added an answer on June 4, 2026 at 11:40 am

    I would put the service in UserBundle, since the UserBundle deals with authentication.

    Generally I like to place services into the bundle to which they are most relevant. I also typically have a “Default” bundle into which I aggregate a limited number of truly generic services, entities, controllers, etc. In theory anything that goes into Default could be used generically in another project and is almost always something required by more than one other bundle. Occasionally I have bits and pieces in Default that mature to a point where they would make more sense in a more specific, yet still generic, bundle (similar to your UserBundle.. I figure it’s probably something that can be dropped into more than one project); these get refactored and named accordingly.

    Once-upon-a-time I used to split out new bundles for anything I perceived to be a “module”. These days, however, I try to limit the number of bundles in an app.. I’ve found this to make the code more clear and easier to manage; especially since my idea for any given module’s “boundaries” is invariable wrong and I end up moving code around. Plus working primarily in one core bundle makes navigating the code a lot more straightforward.

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

Sidebar

Related Questions

We have FireSymfony that allows one to view the Symfony, PHP variables in a
I have a Symfony app that populates the widgets of a portal application and
I have a symfony app that uses the json_encode and json_decode to keep a
I have an app that I'm porting from PHP/symfony to Ruby/Rails. Though the language
In my Symfony/Doctrine app, I have a query that orders by RANDOM(). I call
I have done a svn co for a repository that contains a symfony app.
I have a Symfony application that uses Doctrine as its ORM. Based on Symfony's
I have 3 applications in my Symfony Project : one public app not secured
I have a symfony project with the followin structure SDCU |-app |-----cache |-----logs |-bin
I have a Symfony task that generates some files calls exec to a jar

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.