flipboxfactory / saml-sp

SAML Service Provider (SP) Plugin for Craft CMS
https://saml-sp.flipboxfactory.com/
Other
19 stars 5 forks source link

Add RelayState override #13

Closed dsmrt closed 6 years ago

dsmrt commented 6 years ago

Add the ability to override the RelayState.

An example would be a button like so:

<a href="{{ loginUrl }}?RelayState=/my/area">Login</a>

That get variable will be used to override any other logic to obtain a relay state.

nateiler commented 6 years ago

My vote is to make this GET variable configurable via the plugin settings. In one case it may be 'RelayState' another may be 'redirect', etc.

nateiler commented 6 years ago

This is work around:

{% requireLogin %}

{% set redirectUrl = craft.app.request.getParam('relayState') %}

{% redirect redirectUrl 302 %}
dsmrt commented 6 years ago

Added in 1.0.0-beta.14. You can pass the param as suggested and it will override the craft return url by passing the default parameter RelayState or you can change that name by adding relayStateOverrideParam to your config/saml-sp.php.