ecphp / cas-bundle

CAS Bundle, a standard Symfony bundle for authentication using CAS protocol.
https://ecphp-cas-bundle.readthedocs.io
BSD 3-Clause "New" or "Revised" License
43 stars 9 forks source link

Get rid of sensio/framework-extra-bundle #43

Closed drupol closed 1 year ago

drupol commented 3 years ago

We currently need to rely on sensio/framework-extra-bundle to provide the necessary interface wiring to the nyholm/psr7 package.

Since the new version 6, those wiring are now gone.

We need to find a way to continue using this package without sension/framework-extra-bundle.

Relates to https://github.com/ajgarlag/psr-http-message-bundle/pull/5

smbpunt commented 3 years ago

Hi,

I don't know if it's related...

I just started a new 5.3 project. Right after installing the skeleton, I tried to install your bundle and I have an error

You have requested a non-existent service "sensio_framework_extra.psr7.http_message_factory".

drupol commented 3 years ago

Yes, this is indeed related. Going to check this and provide some feedback.

drupol commented 3 years ago

Hi,

It's removed on master branch, could you please test the master branch? If it works, I'll tag/bump a new release.

composer require ecphp/cas-bundle:dev-master

You might set minimum-stability and prefer-stable properties to dev and true respectively to composer.json.

smbpunt commented 3 years ago

Hey,

Thanks for the quick response !

So I follow your instructions. It fixed the installation.

But then, I have 2 problems :

  1. When you follow the installation instruction, you ask to edit "config/packages/security" on step 2.
    firewalls:
        main:
            anonymous: ~
            guard:
                provider: cas
                authenticators:
                    - cas.guardauthenticator

You have one error : The authenticator manager no longer has "anonymous" security. Please remove this option under the "main" firewall.

So I removed anonymous and it's fixed.

  1. Then I have this error : Cannot autowire service "cas": argument "$uriFactory" of method "EcPhp\CasLib\Cas::__construct()" references interface "Psr\Http\Message\UriFactoryInterface" but no such service exists. You should maybe alias this interface to the existing "psr18.http_client" service.
drupol commented 3 years ago

That's a good feedback, thanks!

cas-bundle/cas-lib requires a psr17 implementation, to fix that, just do:

composer require loophp/psr17

Let me know if this has fixed your issue, I'll update everything accordingly.

smbpunt commented 3 years ago

I first had to install composer require nyholm/psr7 as suggested in loophp/psr17 installation.

Then composer require loophp/psr17, I changed the base_url to https://casserver.herokuapp.com/cas and it works !

drupol commented 3 years ago

Nice ! On next Monday I'm going to update the composer.json, documentation and so on.

smbpunt commented 3 years ago

Thanks for the quick feedbacks and solutions !

drupol commented 3 years ago

you're welcome!

drupol commented 3 years ago

Dear @Punt13140,

I'm giving a second look at this right now. I don't think loophp/psr17 is needed for now. Could you please try to remove the package and see if everything still works?

Thanks!

smbpunt commented 3 years ago

Hey,

Sorry I've been busy.

So I removed

        "loophp/psr17": "^1.0",
        "nyholm/psr7": "^1.4",

from composer.json and then composer update.

And I have this error Attempted to load class "Psr17Factory" from namespace "Nyholm\Psr7\Factory". Did you forget a "use" statement for another namespace?.

I'm on master branch.

drupol commented 3 years ago

No, can you please only remove loophp/psr17 and give me the full error ? (a screenshot is fine as well!)

smbpunt commented 3 years ago

It works !

drupol commented 3 years ago

Riiiight, loophp/psr17 is not needed for now, that's what I thought!

Thanks a lot for your assistance, I will update the packages accordingly in the upcoming days.

drupol commented 1 year ago

Hello,

Can I close this issue?

smbpunt commented 1 year ago

Hi @drupol, Sorry I forgot to reply. You can close this issue.

Thanks