如何在Symfony4.3中安装HWIOAuthBundle? [英] How to install HWIOAuthBundle in Symfony4.3?
问题描述
如果我尝试使用命令
composer需要hwi/oauth-bundle php-http/guzzle6-adapter php-http/httplug-bundle
composer require hwi/oauth-bundle php-http/guzzle6-adapter php-http/httplug-bundle
我有这个错误:
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
该捆绑软件可与Symfony4.3一起使用吗?
Is that bundle works with Symfony4.3 ?
\ = \ = \ = \ = \ = \ = \ = \ = \ = \ = \ = \ = \\\\\ === \
\=\=\=\=\=\=\=\=\=\=\=\=\\\\===\
使用以下命令成功安装:
Installed successfully with commands:
撰写者需要php-http/guzzle6-adapter = ^ 1.1
composer require php-http/guzzle6-adapter=^1.1
composer requirehwi/oauth-bundle php-http/httplug-bundle
composer requirehwi/oauth-bundle php-http/httplug-bundle
如@Taher Ben sassi所指出的.
as @Taher Ben sassi pointed.
我的配置. 在security.yaml中:
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
在services.yaml
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']
推荐答案
1.0,支持Symfony:^ 3.4& ^ 4.2.
1.0 with support for Symfony: ^3.4 & ^4.2.
第1步:
composer require php-http/guzzle6-adapter=^1.1
第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 . 在GH中提及
在服务中设置hwi_oauth
Set hwi_oauth in service
hwi_oauth:
firewall_name: secured_area
这篇关于如何在Symfony4.3中安装HWIOAuthBundle?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!