Closed SETU-WEB closed 7 months ago
👋 @WITwebmaster ,
If you need to make it an event use the guide here to implement the event within a custom module. I'm not familiar with the syntax you are using ('on <eventName
) within craft. This is how I do it: https://craftcms.com/knowledge-base/custom-module-events
Also, depending on your use case, there could be simpler ways to achieve this. Is this static, like it never changes?
RelayState
get parameter on the button that kicks off the sso process when sso is initiated from craft. Something like: ?RelayState= /admin/myaccount?site=default
. NOTE: That value actually has to be base64'd but for ease of the example, I'm showing the raw string. But this might not work if they are probably using the via buttons on the cp login screen.NOTE (on my notes): here is an example on how to base64 the string you referenced above and what the get param should look like when it's sent back to the craft
echo "/admin/myaccount?site=default" | base64
Which should ultimately look like the follow: RelayState=L2FkbWluL215YWNjb3VudD9zaXRlPWRlZmF1bHQK
Hi Thanks for such a comprehensive answer. I think adding the relay state is the best way to go and I have talked to out IT dept about it . They have done relaynstate before on other azure saml setups, but they have always used a simple URL .They want to know is there any reason why it needs to be base64 as they have tried L2FkbWluL215YWNjb3VudD9zaXRlPWRlZmF1bHQK and it doesn't work Thanks
The plugin expects it to be base64. This is common with relaystate and other saml get parameter based messages to avoid encoding issues in the url. There is a config in the saml-sp.php that you can set to tell it to except non-base64’d strings if desired.
I’d also recommend seeing what the logging says. If it’s not working as a base 64 string something is wrong in the process and there is logging around relaystate
Great thanks for the feedback , I am meeting the IT guys on Monday so I will pass on your answer and hopefully get it sorted
Sorry I forgot to close this one. In the end as my url will never change, I went with the approach of taking the link button url and changing the final segment to point to the user page. I create a redirect called sitename/staffprofile and pointed it to that URL and it all works nicely. Thanks for the help
Hi Hope you could give me some guidance on how to redirect on saml login. I am using the user directory as a staff profile facility with custom fields, and I want to redirect users to /admin/myaccount?site=default on login. I tried this in my saml.sp.php config but it didn't work
Any help is very appreciated