lightSAML / SpBundle

SAML2 SP Symfony Bundle based on LightSAML
https://www.lightsaml.com/SP-Bundle/
MIT License
66 stars 70 forks source link

Question: Custom redirect URL after successfull login #48

Closed berny46 closed 7 years ago

berny46 commented 7 years ago

Hi everyone, is it possible to redirect the User to a different URL than the one he initially came from? Let's say User is on example.com/shop, clicked on example.com/login, get's redirected to my IDP and I want to redirect him back to example.com/shop after successfull login.

Edit: To clarify what I'd like to do: When using simplesamlphp you can do something like that:

$auth->requireAuth(array( 'ReturnTo' => 'https://sp.example.org/mycustompath' )); @tmilos Any Idea?

Thanks Chris

Edit: Question on stackoverflow

tmilos commented 7 years ago

This is a standard Symfony feature. You should use default_target_path security listener configuration option. It's not listed on LightSAML Sp Bundle configuration since it's a standard Symfony option, though I might add it to avoid the confusion.