Skip to content

Service with dependency to fos_oauth_server.client_manager connects to database #422

Open

Description

@havvg

When having a service with a dependency to fos_oauth_server.client_manager, the connection to the database is established. I worked around it be marking the fos_oauth_server.client_manager lazy=true.

If that's a valid solution to you, I will send a PR, otherwise please tell me what to do?

Activity

  1. changed the title [-]Service with dependency to `fos_oauth_server.client_manager` connects to database[/-] [+]Service with dependency to fos_oauth_server.client_manager connects to database[/+] on Jul 20, 2016
  2. abienvenu commented on Nov 18, 2016

    @abienvenu

    This is a serious issue. There is a connection established to the oauth database for every request processed by the Symfony framework as soon as FOSOAuthServerBundle is configured and there is a "fos_oauth: true" somewhere in the app/config/security.yml configuration file. If one has a big website with only a small part of it protected by OAuth, this is a waste of resources.

    The problem comes from Entity/ClientManager and Entity/TokenManager which instantiate a repository in their constructor.

    lazy=true does not appear as an ideal solution to me, because it relies on ocramius/proxy-manager to be installed.

    Here is my attempt to address this issue : #440

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions