flipboxfactory / saml-sp

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

Create plugin variable for /sso/logout/request (and more) #9

Closed dsmrt closed 5 years ago

dsmrt commented 6 years ago

Issue raised in https://github.com/flipboxfactory/saml-sp/issues/8.

A plugin variable is needed for items like /sso/logout/request. This way we can reference the logout link on a logout but like so <a href="{{ samlSp.logoutEndpoint }}">Logout</a> (for example), and not have to hard code it like the following <a href="/sso/logout/request">Logout</a>.

dsmrt commented 6 years ago

In 1.0.0-RC1, you can now get the default logout request endpoint by using grabbing it from the settings model like so:

{{ craft.samlSp.settings.logoutRequestEndpoint }}
dsmrt commented 6 years ago

I'm going to keep this open because, with the 1.0.0-RC1 update, I added the capability handle multiple providers. This adds the ability to target those IDPs explicitly thru id'd requested urls like /sso/login/require/<provider-uid>. Currently, I don't have an easy way to get those urls system wide, based on provider.

dsmrt commented 5 years ago

I've gone back and forth on this. I think doing something like this is the best:

craft.samlSp.settings.getDefaultLogoutRequestEndpoint()

The use case looks like this:

<a href="{{ craft.samlSp.settings.getDefaultLogoutRequestEndpoint() }}">logout</a>