0

If i try install this bundle like it described in docs with command

composer require hwi/oauth-bundle php-http/guzzle6-adapter php-http/httplug-bundle

i have this error:

Problem 1
        - Installation request for hwi/oauth-bundle ^0.6.3 -> satisfiable by hwi/oauth-bundle[0.6.3].
        - Installation request for php-http/httplug-bundle ^1.16 -> satisfiable by php-http/httplug-bundle[1.16.0].
        - php-http/httplug-bundle 1.16.0 requires php-http/client-implementation ^1.0 -> satisfiable by php-http/guzzle6-adapter[v2.0.0, v2.0.1].
        - php-http/guzzle6-adapter v2.0.0 requires php-http/httplug ^2.0 -> satisfiable by php-http/httplug[v2.0.0].
        - php-http/guzzle6-adapter v2.0.1 requires php-http/httplug ^2.0 -> satisfiable by php-http/httplug[v2.0.0].
        - Conclusion: don't install php-http/httplug v2.0.0

if i try to install this packages one by one i have similar output:

Problem 1
    - Installation request for hwi/oauth-bundle ^0.6.3 -> satisfiable by hwi/oauth-bundle[0.6.3].
    - hwi/oauth-bundle 0.6.3 requires php-http/client-implementation ^1.0 -> no matching package found.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it

Is that bundle works with Symfony4.3 ?

\=\=\=\=\=\=\=\=\=\=\=\=\\\\===\

Installed successfully with commands:

composer require php-http/guzzle6-adapter=^1.1

composer requirehwi/oauth-bundle php-http/httplug-bundle

as @Taher Ben sassi pointed.

My config. in security.yaml:

firewalls:
    main:
        anonymous: ~
        oauth:
        resource_owners:
            facebook:           "/login/check-facebook"
            google:             "/login/check-google"
            my_custom_provider: "/login/check-custom"
            my_github:          "/login/check-github"
        login_path:        /login
        use_forward:       false
        failure_path:      /login
        provider: users
        oauth_user_provider:
            service: my.oauth_aware.user_provider.service

in services.yaml

my.oauth_aware.user_provider.service:
        class: HWI\Bundle\OAuthBundle\Security\Core\User\FOSUBUserProvider
        arguments:
            - '@fos_user.user_manager'
            - ['pass properties as array']
Loctarogar
  • 540
  • 3
  • 10
  • 29

1 Answers1

2

HWIOAuthBundle

1.0 with support for Symfony: ^3.4 & ^4.2.

Step 1 :

composer require php-http/guzzle6-adapter=^1.1

Step 2 :

composer require hwi/oauth-bundle php-http/httplug-bundle

composer.json

[...]
"require": {
    [...]
    "hwi/oauth-bundle": "^0.6.3",
    "php-http/guzzle6-adapter": "^1.1",
    "php-http/httplug-bundle": "^1.13",
    [...]
 }
[...]

UPDATE. Mention in GH

Set hwi_oauth in service

hwi_oauth:
   firewall_name: secured_area
Taher Ben sassi
  • 120
  • 2
  • 14
  • still have some error: The service "hwi_oauth.security.oauth_utils" has a dependency on a non-exis !! tent service "hwi_oauth.resource_ownermap.main". – Loctarogar Sep 06 '19 at 10:24
  • hwi_oauth is not active in your firewall_name firewall – Taher Ben sassi Sep 06 '19 at 10:26
  • I should put ```hwi_oauth: firewall_name: secured_area``` in "config.yaml" file, but in symfony4 there is no such, so where should i put it? I tried in "security.yaml" and in "services.yaml" but i have error. – Loctarogar Sep 06 '19 at 12:19
  • To your security.yaml – Taher Ben sassi Sep 06 '19 at 12:35
  • ``` Unrecognized option "hwi_oauth" under "security"``` i have that error – Loctarogar Sep 06 '19 at 12:38
  • @Loctarogar In general it is best to stick to one question at a time. This question was how to install using composer and has been answered. Consider opening a new question concerning configuration after reading through the bundle's docs and following the examples. – Cerad Sep 06 '19 at 12:44
  • @Loctarogar I just tried a fresh install and got the same error. Probably should not have accepted the answer if it did not work. Bit misleading. As is all this firewall stuff. Don't know what the solution is. Kind of suspect the bundles does not work under 4.3 at all. – Cerad Sep 06 '19 at 12:59
  • @Cerad as you pointed above the question was how to install. I installed that bundle, but different question how to configure it. – Loctarogar Sep 06 '19 at 13:42
  • 1
    @Loctarogar The reason I say it is misleading it that the installation did not actually complete. You got an error message after doing composer require and composer.json was rolled back. There should not have been any "out of the box" errors. And while I hope I am wrong, I doubt if any amount of configuration will fix this. Issue 598 is 5 years old and probably not applicable. [Open Issue 1553](https://github.com/hwi/HWIOAuthBundle/issues/1553) might be more applicable. – Cerad Sep 06 '19 at 14:19