SingleSignOnIdentityProviderBundle icon indicating copy to clipboard operation
SingleSignOnIdentityProviderBundle copied to clipboard

Error implementing this

Open marvoh opened this issue 8 years ago • 10 comments

I am getting the error below when I try to implement this bundle:

The service "krtv_single_sign_on_identity_provider.uri_signer" has a dependency on a non-existent parameter "uri_signer.class".

I believe the error comes from this line

<service id="krtv_single_sign_on_identity_provider.uri_signer" class="%uri_signer.class%"> <argument/> <!-- secret --> </service>

uli_signer.class is not defined in the parameters here

<parameters>
        <parameter key="krtv_single_sign_on_identity_provider.security.firewall_id">main</parameter>
        <parameter key="krtv_single_sign_on_identity_provider.security.authentication.otp_manager.orm.class">Krtv\SingleSignOn\Manager\ORM\OneTimePasswordManager</parameter>
        <parameter key="krtv_single_sign_on_identity_provider.encoder.otp.class">Krtv\SingleSignOn\Encoder\OneTimePasswordEncoder</parameter>

        <parameter key="krtv_single_sign_on_identity_provider.routing.loader.class">Krtv\Bundle\SingleSignOnIdentityProviderBundle\Routing\SsoRoutesLoader</parameter>
        <parameter key="krtv_single_sign_on_identity_provider.entity.class">Krtv\Bundle\SingleSignOnIdentityProviderBundle\Entity\OneTimePassword</parameter>

        <parameter key="krtv_single_sign_on_identity_provider.manager.service_manager.class">Krtv\Bundle\SingleSignOnIdentityProviderBundle\Manager\ServiceManager</parameter>
        <parameter key="krtv_single_sign_on_identity_provider.manager.logout_manager.class">Krtv\Bundle\SingleSignOnIdentityProviderBundle\Manager\LogoutManager</parameter>

        <parameter key="krtv_single_sign_on_identity_provider.event_listner.service_subscriber.class">Krtv\Bundle\SingleSignOnIdentityProviderBundle\EventListener\TargetPathSubscriber</parameter>
        <parameter key="krtv_single_sign_on_identity_provider.security.http_utils.class">Krtv\Bundle\SingleSignOnIdentityProviderBundle\Security\Http\HttpUtils</parameter>
    </parameters>

marvoh avatar Apr 15 '17 07:04 marvoh

Looks like Symfony has removed uri_signer.class parameter in release that you use. I'll try to provide a quick fix soon.

This issue was fixed in the korotovsky/sso-idp-bundle@~3.0. Please use this version constraint

korotovsky avatar Apr 15 '17 09:04 korotovsky

Another error experienced,

"Target path not specified" at 'vendor/korotovsky/sso-idp-bundle/src/Krtv/Bundle/SingleSignOnIdentityProviderBundle/Controller/SingleSignOnController.php line 29

marvoh avatar Apr 17 '17 17:04 marvoh

@marvoh When SP redirects (or IdP security handler) user to IdP it should also append _target_path parameter with correct value. Please check an example here: https://github.com/korotovsky/SingleSignOnIdentityProviderBundle/blob/0.3.x/tests/Krtv/Bundle/SingleSignOnIdentityProviderBundle/Tests/Controller/SingleSignOnControllerTest.php#L223

korotovsky avatar Apr 18 '17 12:04 korotovsky

Hello @korotovsky I have the same problem, where should I append _target_path parameter into the SP ? There is no controller, it's into the ServiceProvider ? eg. the link ^

when I go on my SP : http://service.sf I'm redirected to IDP : http://idp.sf/login?_otp_failure=1&_otp_failure_time=1500471910.3835&_hash=03efZYChjtbZCorjTrDfCNVX0EpoExKeYIE1z1UGGK8%3D

And /otp/validate/ == > /internal/v1/sso/ same route ?

thanks

mediafigaro avatar Jul 19 '17 14:07 mediafigaro

Hi,

/otp/validate/ is a route on SP to make server-side, trusted request to your IdP.

/internal/v1/sso/ is a route that accepts a code that SP provided for verification and should respond with a model or throw bad request.

korotovsky avatar Jul 19 '17 14:07 korotovsky

ok, fine. In the login form, the target path is : ?

< input type="hidden" name="_target_path" id="_target_path" value="http://idp.sf/sso/login/?_failure_path=http%3A%2F%2Fidp.sf%2Fsso%2Flogin%3F_target_path%3Dhttp%253A%252F%252Fservice.sf%252Fapp_dev.php%252F%253F_hash%253DMD3NplbZW%25252BylHUDxQcvLG%25252FXMn71mnSts6tx9MQmbg1k%25253D&_hash=UkT2K8tB1ydtsJTRCoZUgoAVs%2B8sjx8P2ttiCSYdpo8%3D&_target_path=http%3A%2F%2Fservice.sf%2Fotp%2Fvalidate%2F%3F_target_path%3Dhttp%253A%252F%252Fservice.sf%252Fapp_dev.php%252F%253F_hash%253DMD3NplbZW%25252BylHUDxQcvLG%25252FXMn71mnSts6tx9MQmbg1k%25253D&service=consumer1" / >

mediafigaro avatar Jul 19 '17 14:07 mediafigaro

@mediafigaro See this test: https://github.com/korotovsky/SingleSignOnIdentityProviderBundle/blob/0.3.x/tests/Krtv/Bundle/SingleSignOnIdentityProviderBundle/Tests/Controller/SingleSignOnControllerTest.php#L223

korotovsky avatar Jul 19 '17 14:07 korotovsky

@korotovsky I try but it must be malformed : http://idp.sf/sso/login/?_target_path=http%3A%2F%2Fservice.sf%2Fotp%2Fvalidate%2F%3F_target_path%3Dhttp%3A%2F%2Fservice.sf%2F&_hash=aA6jVJkP12UYgWq2xYLK12BLkuD4kEy%2FDRscQgKMULg%3D => http://idp.sf/sso/login/?_hash=VwiArTpUP1weqGrSIEN%2FCteuG9qO1kUfeNGh9xTHOss%3D&_otp_failure=1&_otp_failure_time=1500543713.9806 (url malformed, _target_path missing)

mediafigaro avatar Jul 20 '17 09:07 mediafigaro

@korotovsky my url couldn't be validated because of the tld : locally I use .sf with docker. Switched to .com, finner. I just don't see where to append / add the _target_path ?

in the login form (Step 9: Add redirect path to login form) = this value is posted.

When I access my SP I'm redirected to : IDP/login?_otp_failure=1&_otp_failure_time=1501253793.2919&_hash=1XDY.... without _target_path

Where should it be inserted please ?

mediafigaro avatar Jul 28 '17 14:07 mediafigaro

that's handled by the LoginSuccessHandler, this is well configured ?

    main:
        pattern:    ^/
        security:   true
        anonymous:  true
        http_basic:
            realm: "Secured Demo Area"
        form_login:
            login_path: login
            check_path: login
            success_handler: app_bundle.security.login_success_handler
        logout:
            path: /logout
            success_handler: app_bundle.security.logout_success_handler

mediafigaro avatar Jul 28 '17 15:07 mediafigaro