Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inject further assertions #9

Open
gawpertron opened this issue Aug 31, 2017 · 4 comments
Open

Inject further assertions #9

gawpertron opened this issue Aug 31, 2017 · 4 comments

Comments

@gawpertron
Copy link

gawpertron commented Aug 31, 2017

In the Service Provider's \LightSaml\Builder\Action\Profile\SingleSignOn\Sp\SsoSpSendAuthnRequestActionBuilder there is an opportunity to attach a listener that can manipulate the Profile Context or Outbound Message before the message is signed or encrypted.

However in the Identity Provider's
\LightSaml\Idp\Builder\Action\Profile\SingleSignOn\Idp\SsoIdpAssertionActionBuilder there is no such like dispatch event handler before the Outbound Message is signed or encrypted.

Is there an alternate way of adding Assertions to the LoginResponse before signing and encryption?

@gawpertron
Copy link
Author

gawpertron commented Aug 31, 2017

I may have answered my own question: Looks like this could be done by adding a callback factory for \LightSaml\Bridge\Pimple\Container\ProviderContainer::ATTRIBUTE_VALUE_PROVIDER container service. there is an example in lightsaml/lightsaml-idp/web/idp/_config.php in IdpConfig::buildProviderContext()

@tmilos
Copy link
Member

tmilos commented Aug 31, 2017

Don't know what \Dms\Saml\* is.

In LightSAML if you want to manipulate outgoing message before the signing or encryption, you should add a custom action to the action builder with according priority, for example

$builder = new \LightSaml\Idp\Builder\Action\Profile\SingleSignOn\Idp\SsoIdpAssertionActionBuilder($buildContainer);
$builder->add(new MyCustomAction(), 120);
$action = $builder->build();

Though, priorities in https://github.com/lightSAML/lightSAML-IDP/blob/master/src/LightSaml/Idp/Builder/Action/Profile/SingleSignOn/Idp/SsoIdpAssertionActionBuilder.php#L83 are not distributed and spaced well, so atm you won't quite be able to do that. A fix would require each action in the builder to get a priority with some spacing from before, so others like you can inject custom actions in between.

@tmilos
Copy link
Member

tmilos commented Aug 31, 2017

Attribute value provider is used to provide attributes that will be put in the assertion.
Note that you don't have to use pimple, it was added to the lib just as one of possible implementations. There's also lightSAML/SymfonyBridgeBundle which implements Symfony DPI container.

@gawpertron
Copy link
Author

Ah, I didn't notice that you could add Actions at different priorities, that's useful to know for the future.

I have mutiple ZF2/3 projects that I've managed to create wrappers and proxy classes to use the existing examples and profiles. Not ideal, if I had more time I would port the models to use the native ZF2 Service Manager, Event Manager, Session Containers and Request/Response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants