How to install HWIOAuthBundle in Symfony4.3? - symfony

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']

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

Related

Composer update probleme on cpanel for symfony

I have a problem for a symfony app when I try to install dependencies with composer :
Your requirements could not be resolved to an installable set of packages.
Problem 1
- symfony/framework-bundle[v6.0.0, ..., v6.0.12] require composer-runtime-api >=2.1 -> found composer-runtime-api[2.0.0] but it does not match the constraint.
- Root composer.json requires symfony/framework-bundle 6.0.* -> satisfiable by symfony/framework-bundle[v6.0.0, ..., v6.0.12].
Composer version I have on cpanel : 2.0.8
I didn't upgrade composer to the last version.
symfony/framework-bundle[v6.0.0, ..., v6.0.12] require composer-runtime-api >=2.1 -> found composer-runtime-api[2.0.0] but it does not match the constraint.
That line basically tells you that Symfony in v6 requires any Composer version equal or above 2.1, and you are currently using Composer v2.0. Please update Composer itself, for example by using composer self-update

symfony 4.4 sonata admin and sonata user compatible issue

I tried to install symfony 4.4 instead. after the installation, I tried to install sonata user bundle and got this error:
The child node "db_driver" at path "fos_user" must be configured.
then I followed this link
https://stackoverflow.com/a/49034641 to create fos_user.yaml
and I got this error:
The service "fos_user.mailer.default" has a dependency on a non-existent service "templating".
then I followed this link
FriendsOfSymfony/FOSUserBundle#2679 (comment)
and I got this error:
The service "sonata.user.admin.user" has a dependency on a non-existent service "sonata.admin.manager.orm".
and I followed this link:
#1050 (comment)
and I got this error:
There is no extension able to load the configuration for "fos_user" (in "/fsys1/home/public_html/mycel7/config/packages/fos_user.yaml"). Looked for namespace "fos_user", found ""framework", "sensio_framework_extra","twig", "web_profiler", "monolog", "debug", "maker", "doctrine", "doctrine_migrations", "security", "twig_extra", "knp_menu", "sonata_doctrine", "sonata_twig", "sonata_form", "sonata_block", "sonata_exporter", "sonata_admin","sonata_doctrine_orm_admin"" in /fsys1/home/public_html/mycel7/config/packages/fos_user.yaml (which is loaded in resource "/fsys1/home/public_html/mycel7/config/packages/fos_user.yaml").
at this step I am not sure what to do then.
This is my config/packages/fos_user.yaml :
fos_user: db_driver: orm firewall_name: main user_class: Entity\User from_email: address: "test#gmail.com" sender_name: "test"
This is my config/packages/framework.yaml:
framework: secret: '%env(APP_SECRET)%' session: handler_id: null cookie_secure: auto cookie_samesite: lax #esi: true #fragments: true php_errors: log: true templating: engines: twig
symfony version is 4.4.
other files are un-touched

Can not update google/cloud-firestore [composer]

Now, I am using google/cloud-firestore ^0.8.1 and I want to update this library to latest version (0.14.0).
My composer.json now looks like:
"require": {
"grpc/grpc": "^1.10",
"google/protobuf": "^3.5",
"google/gax": "^0.31.3",
"google/cloud-firestore": "^0.8.1",
"firebase/php-jwt": "^5.0",
}
When I try to update firestore library with php composer.phar require google/cloud-firestore
, I got:
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for google/cloud-firestore ^0.14.0 -> satisfiable by google/cloud-firestore[v0.14.0].
- google/cloud-firestore v0.14.0 requires google/gax ^0.37 -> satisfiable by google/gax[0.37.0] but these conflict with your requirements or minimum-stability.
Installation failed, reverting ./composer.json to its original content.
After that, I tried with php composer.phar require google/gax and got:
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- google/cloud-firestore v0.8.1 requires google/gax ^0.31.1 -> satisfiable by google/gax[0.31.x-dev].
- google/cloud-firestore v0.8.1 requires google/gax ^0.31.1 -> satisfiable by google/gax[0.31.x-dev].
- google/cloud-firestore v0.8.1 requires google/gax ^0.31.1 -> satisfiable by google/gax[0.31.x-dev].
- Can only install one of: google/gax[0.37.0, 0.31.x-dev].
- Installation request for google/gax ^0.37 -> satisfiable by google/gax[0.37.0].
- Installation request for google/cloud-firestore ^0.8.1 -> satisfiable by google/cloud-firestore[v0.8.1].
Installation failed, reverting ./composer.json to its original content.
I added "minimum-stability": "dev" to composer.json but that didn't resolve problem.
How to properly update these libraries and fix dependencies between them?
The semantic versioning operator (^) behaves slightly different with pre-1.0 releases (see https://getcomposer.org/doc/articles/versions.md#caret-version-range-):
For pre-1.0 versions it also acts with safety in mind and treats ^0.3 as ?>=0.3.0 <0.4.0.
This means that you will have to update both packages like this:
composer require google/cloud-firestore:^0.14 google/gax:^0.37
With #xabbuh help, I find out solution.
There wasn't problem just in semantic versioning operator (^) but in packages I wanted to update.
I needed to install/update all packages that are needed for updating firestore on version 0.14. I called composer require google/cloud-firestore:^0.14 and after that composer require google/gax:^0.37 and after that tried with reverse order, but there were similar error messages.
When I included all packages needed into require command for updating firestore package it passed well.
So, here are working command:
composer require google/cloud-firestore:^0.14 google/gax:^0.37 google/auth:^1.3 google/grpc-gcp:^0.1.0 grpc/grpc:^1.13.0 google/cloud-core:^1.23

The composer does not see php-curl

Good afternoon at installation drupal 8 by use composer screenshot. I get the following dependency error. screenshot error
On my local machine installation was successful and without a problem. But I do not want to work on the server. At what on another user, the co-op is working like normal.
As far as I understood, he asks for the installation of a php-curl. But he is clever.
I was eating to reset the php-curl and php-cli and restart the server and also run from the user root but nothing helped.
Error:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- webflo/drupal-core-require-dev 8.5.3 requires behat/mink-selenium2-driver 1.3.x-dev -> satisfiable by behat/mink-selenium2-driver[1.3.x-dev].
- webflo/drupal-core-require-dev 8.5.4 requires behat/mink-selenium2-driver 1.3.x-dev -> satisfiable by behat/mink-selenium2-driver[1.3.x-dev].
- webflo/drupal-core-require-dev 8.5.5 requires behat/mink-selenium2-driver 1.3.x-dev -> satisfiable by behat/mink-selenium2-driver[1.3.x-dev].
- webflo/drupal-core-require-dev 8.5.x-dev requires behat/mink-selenium2-driver 1.3.x-dev -> satisfiable by behat/mink-selenium2-driver[1.3.x-dev].
- behat/mink-selenium2-driver 1.3.x-dev requires instaclick/php-webdriver ~1.1 -> satisfiable by instaclick/php-webdriver[1.1, 1.1.1, 1.2, 1.2.1, 1.2.2, 1.3.0, 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5].
- instaclick/php-webdriver 1.4.5 requires ext-curl * -> the requested PHP extension curl is missing from your system.
- instaclick/php-webdriver 1.4.4 requires ext-curl * -> the requested PHP extension curl is missing from your system.
- instaclick/php-webdriver 1.4.3 requires ext-curl * -> the requested PHP extension curl is missing from your system.
- instaclick/php-webdriver 1.4.2 requires ext-curl * -> the requested PHP extension curl is missing from your system.
- instaclick/php-webdriver 1.4.1 requires ext-curl * -> the requested PHP extension curl is missing from your system.
- instaclick/php-webdriver 1.4.0 requires ext-curl * -> the requested PHP extension curl is missing from your system.
- instaclick/php-webdriver 1.3.0 requires ext-curl * -> the requested PHP extension curl is missing from your system.
- instaclick/php-webdriver 1.2.2 requires ext-curl * -> the requested PHP extension curl is missing from your system.
- instaclick/php-webdriver 1.2.1 requires ext-curl * -> the requested PHP extension curl is missing from your system.
- instaclick/php-webdriver 1.2 requires ext-curl * -> the requested PHP extension curl is missing from your system.
- instaclick/php-webdriver 1.1.1 requires ext-curl * -> the requested PHP extension curl is missing from your system.
- instaclick/php-webdriver 1.1 requires ext-curl * -> the requested PHP extension curl is missing from your system.
- Installation request for webflo/drupal-core-require-dev ~8.5.3 -> satisfiable by webflo/drupal-core-require-dev[8.5.3, 8.5.4, 8.5.5, 8.5.x-dev].
To enable extensions, verify that they are enabled in your .ini files:
- /etc/php/7.0/cli/php.ini
- /etc/php/7.0/cli/conf.d/10-mysqlnd.ini
- /etc/php/7.0/cli/conf.d/10-opcache.ini
- /etc/php/7.0/cli/conf.d/10-pdo.ini
- /etc/php/7.0/cli/conf.d/15-xml.ini
- /etc/php/7.0/cli/conf.d/20-calendar.ini
- /etc/php/7.0/cli/conf.d/20-ctype.ini
- /etc/php/7.0/cli/conf.d/20-curl.ini
- /etc/php/7.0/cli/conf.d/20-dom.ini
- /etc/php/7.0/cli/conf.d/20-exif.ini
- /etc/php/7.0/cli/conf.d/20-fileinfo.ini
- /etc/php/7.0/cli/conf.d/20-ftp.ini
- /etc/php/7.0/cli/conf.d/20-gd.ini
- /etc/php/7.0/cli/conf.d/20-gettext.ini
- /etc/php/7.0/cli/conf.d/20-iconv.ini
- /etc/php/7.0/cli/conf.d/20-imap.ini
- /etc/php/7.0/cli/conf.d/20-intl.ini
- /etc/php/7.0/cli/conf.d/20-json.ini
- /etc/php/7.0/cli/conf.d/20-ldap.ini
- /etc/php/7.0/cli/conf.d/20-mbstring.ini
- /etc/php/7.0/cli/conf.d/20-mcrypt.ini
- /etc/php/7.0/cli/conf.d/20-mysqli.ini
- /etc/php/7.0/cli/conf.d/20-pdo_mysql.ini
- /etc/php/7.0/cli/conf.d/20-phar.ini
- /etc/php/7.0/cli/conf.d/20-posix.ini
- /etc/php/7.0/cli/conf.d/20-pspell.ini
- /etc/php/7.0/cli/conf.d/20-readline.ini
- /etc/php/7.0/cli/conf.d/20-shmop.ini
- /etc/php/7.0/cli/conf.d/20-simplexml.ini
- /etc/php/7.0/cli/conf.d/20-soap.ini
- /etc/php/7.0/cli/conf.d/20-sockets.ini
- /etc/php/7.0/cli/conf.d/20-sysvmsg.ini
- /etc/php/7.0/cli/conf.d/20-sysvsem.ini
- /etc/php/7.0/cli/conf.d/20-sysvshm.ini
- /etc/php/7.0/cli/conf.d/20-tokenizer.ini
- /etc/php/7.0/cli/conf.d/20-wddx.ini
- /etc/php/7.0/cli/conf.d/20-xmlreader.ini
- /etc/php/7.0/cli/conf.d/20-xmlwriter.ini
- /etc/php/7.0/cli/conf.d/20-xsl.ini
- /etc/php/7.0/cli/conf.d/20-zip.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
I corrected this problem as follows.
1) Found the extension Curl file
ls /usr/lib/php/20151012/ | grep curl
- result:
curl.so
2) Change path in /etc/php/7.0/cli/php.ini
extension=php_curl.dll --> change on
extension=curl.so

mink-goutte-driver. Can't install fabpot/goutte on Symfony 2.0

I am using composer with Symfony 2.0.15 and migrating to latest Behat 2.4. This is in my composer.json:
"require-dev": {
"behat/behat": "2.4#stable",
"behat/mink-extension": "*",
"behat/symfony2-extension": "*",
"behat/mink-browserkit-driver": "*",
"behat/mink-goutte-driver": "dev-master",
"behat/common-contexts": "*",
"kriswallsmith/buzz": ">=0.5.0"
}
I run: php composer.phar update --dev
And there is an error:
Your requirements could not be solved to an installable set of packages.
Problem 1
- Installation request for behat/mink-goutte-driver dev-master -> satisfiable by behat/mink-goutte-driver dev-master.
- don't install fabpot/goutte 1.0.x-dev|install fabpot/goutte dev-master
- behat/mink-goutte-driver dev-master requires fabpot/goutte 1.0.* -> satisfiable by fabpot/goutte 1.0.x-dev.
- Conclusion: remove symfony/symfony v2.0.15
- fabpot/goutte dev-master requires symfony/dom-crawler 2.1.* -> satisfiable by symfony/symfony 2.1.x-dev, symfony/dom-crawler v2.1.0-BETA1, symfony/dom-crawler 2.1.x-dev, symfony/symfony v2.1.0-BETA1.
- Can only install one of: symfony/symfony v2.0.15, symfony/symfony 2.1.x-dev.
- Can only install one of: symfony/symfony v2.1.0-BETA1, symfony/symfony v2.0.15.
- don't install symfony/symfony v2.0.15|don't install symfony/dom-crawler v2.1.0-BETA1
- don't install symfony/dom-crawler 2.1.x-dev|don't install symfony/symfony v2.0.15
- Installation request for symfony/symfony == 2.0.15.0 -> satisfiable by symfony/symfony v2.0.15.
If I understand the error correctly, it is because fabpot/goutte package is dependent on Symfony 2.1 packages and not available for Symfony 2.0. Correct me, if I am wrong.
Here is my behat.yml:
default:
formatter:
parameters:
paths: false
context:
class: 'Site\PublicBundle\Features\Context\FeatureContext'
parameters:
base_url: 'http://test-anton.site.com'
extensions:
Behat\Symfony2Extension\Extension:
mink_driver: true
bundle: 'PublicBundle'
kernel:
env: test
debug: true
Behat\MinkExtension\Extension:
default_session: symfony2
base_url: 'http://test-anton.site.com'
And this is sample of my failing scenario:
Scenario: User can view homepage
When I go to "/"
Then the response code should be 200
"When I go to" - is a MinkContext step, but "Then the response code should be 200" - is a step from Behat\CommonContexts\WebApiContext. When I use only steps from MinkContext - "Then the response status code should be 200" it works just fine.
The final answer is that Behat\CommonContexts\WebApiContext is not compatible with Behat 2.4.
Might be a stupid question but do you use goutte? I went through a similar update recently and mink-browserkit-driver was all I needed.
I'm not sure why goutte has a dependency on 2.1 and it might be risky to use it with 2.0. If you really need it try defining a custom repository for goutte in your composer.json (and lie about requirements on Symfony).
Update
Notice that error message says "Call to a member function getUri()". It relates to getCurrentUri():
public function getCurrentUrl()
{
return $this->client->getRequest()->getUri();
}
It means that client is there but getRequest() returns null. That suggests request was not made yet.
Did you make a request before accessing its URL?
Installing Goutte won't solve your issue (you don't need it at all).

Resources