Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Has EntityUserProvider ever worked? #1964

Closed
lobodol opened this issue Nov 14, 2023 · 1 comment · Fixed by #1985
Closed

Has EntityUserProvider ever worked? #1964

lobodol opened this issue Nov 14, 2023 · 1 comment · Fixed by #1985

Comments

@lobodol
Copy link

lobodol commented Nov 14, 2023

Q A
Bug? yes
New Feature? no
Support question? yes
Version 2.x

Actual Behavior

Too few arguments to function HWI\Bundle\OAuthBundle\Security\Core\User\EntityUserProvider::__construct(), 1 passed in /var/www/myapp/current/var/cache/dev/ContainerEHdpG4W/getSecurity_Authenticator_Oauth_MainService.php on line 47 and at least 3 expected

Expected Behavior

No error on instantiation of HWI\Bundle\OAuthBundle\Security\Core\User\EntityUserProvider

Steps to Reproduce

Follow the documentation and use the provided service hwi_oauth.user.provider.entity as oauth_user_provider:

# config/security.yaml
security:
    enable_authenticator_manager: true

    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false
        main:
            pattern: ^/
            oauth:
                resource_owners:
                    facebook:           "/login/check-facebook"
                    google:             "/login/check-google"
                login_path:   /login
                use_forward:  false
                failure_path: /login
                oauth_user_provider:
                    service: hwi_oauth.user.provider.entity

Possible Solutions

I think the problem comes from hwi/oauth-bundle/src/Resources/config/oauth.php where only 1 argument is passed to the constructor whereas 3 are expected:

    $services->set('hwi_oauth.user.provider.entity', EntityUserProvider::class)
        ->args([service('doctrine')]);

I would expect something like this:

    $services->set('hwi_oauth.user.provider.entity', EntityUserProvider::class)
        ->args([
                service('doctrine'),
                param('the_name_of_my_user_model'),
                param('I dont really understand this one yet'),
        ]);

This leads me to this question: has this provider ever worked?

@stloyd
Copy link
Collaborator

stloyd commented Feb 16, 2024

I would say, yes it worked, but required manual setup anyway... i.e. this works:

services:
    hwi_oauth.user.provider.entity:
        class: HWI\Bundle\OAuthBundle\Security\Core\User\EntityUserProvider
        arguments:
            $class: App\Entity\User
            $properties:
                'facebook': 'facebook'
                'google': 'google'

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

Successfully merging a pull request may close this issue.

2 participants