idP - custom "redirecting" page after login?

22 views
Skip to first unread message

Mikael Bak

unread,
Sep 19, 2019, 4:09:34 AM9/19/19
to SimpleSAMLphp
Hi list,

We have successfully deployed an idP and integrated it with Hungarian
Research and Educational Federation (HREF). It works very well thanks to
the work you all have done in SimpleSAMLphp over the years. Thank you
all for that!

Sometimes an SP takes longer time to respond after loggin in on the idP.
When that happens the login screen of the idP is gone and a blank page
is showing to the user until the SP responds.

Is there a way to show a custom html page right after login showing
something like "Redirecting. Please wait." instead?

I have been poking around in the SimpleSAMLphp source code without any
luck. I must admit that my knowledge of SAML is limited. My php skills
are somewhat outdated. So I may have missed something obvious.

TIA,

Mikael Bak
National Széchényi Library
Budapest, Hungary.

Jaime Pérez Crespo

unread,
Sep 19, 2019, 5:16:50 AM9/19/19
to noreply-spamdigest via SimpleSAMLphp
Hi Mikael,

On 19 Sep 2019, at 10:09, Mikael Bak <bak.m...@oszk.hu> wrote:
> Hi list,
>
> We have successfully deployed an idP and integrated it with Hungarian
> Research and Educational Federation (HREF). It works very well thanks to
> the work you all have done in SimpleSAMLphp over the years. Thank you
> all for that!

Thanks for your kind words, it makes it really nice to work on a project like this :-)

> Sometimes an SP takes longer time to respond after loggin in on the idP.
> When that happens the login screen of the idP is gone and a blank page
> is showing to the user until the SP responds.
>
> Is there a way to show a custom html page right after login showing
> something like "Redirecting. Please wait." instead?
>
> I have been poking around in the SimpleSAMLphp source code without any
> luck. I must admit that my knowledge of SAML is limited. My php skills
> are somewhat outdated. So I may have missed something obvious.

You can create your own theme. Previously, this page in particular was hardcoded, but it’s not any longer, so you can override it with your own theme if you like:

https://simplesamlphp.org/docs/stable/simplesamlphp-theming

In this case, you would need to the following file in your own theme:

<SSP_ROOT>/modules/yourmodule/themes/yourtheme/default/post.php

Note also that we are migrating to twig templates, so if you are going to do this, it’s probably a good idea to implement this in twig already as well.

--
Jaime Pérez
Uninett / Feide

PGP: 9A08 EA20 E062 70B4 616B 43E3 562A FE3A 6293 62C2
https://keybase.io/jaimeperez

"Two roads diverged in a wood, and I, I took the one less traveled by, and that has made all the difference."
- Robert Frost

Mikael Bak

unread,
Sep 19, 2019, 6:31:13 AM9/19/19
to simple...@googlegroups.com
Hi Jaime,

On 2019. 09. 19. 11:16, 'Jaime Pérez Crespo' via SimpleSAMLphp wrote:
>
> You can create your own theme. Previously, this page in particular was hardcoded, but it’s not any longer, so you can override it with your own theme if you like:
>
> https://simplesamlphp.org/docs/stable/simplesamlphp-theming
>

We do have a theme of our own already because we needed a custom login page.

> In this case, you would need to the following file in your own theme:
>
> <SSP_ROOT>/modules/yourmodule/themes/yourtheme/default/post.php
>

I did create a simple post.php like this:

<?php
echo "Redirecting..."
?>

After login the text "Redirecting..." is shown on the screen, but the
redirection to the SP is not happening. Seems I need to add something
else to my custom post.php in order to make it work.

Is there an example post.php somewhere I can take a look at?

TIA,
Mikael

Jaime Pérez Crespo

unread,
Sep 19, 2019, 6:38:06 AM9/19/19
to simple...@googlegroups.com
Hi again,
Well, of course :-)

You are overriding the original template, so everything in the default one is now missing, including the SAML response and the javascript code that auto-submits it. Have a look at templates/post.php.

Mikael Bak

unread,
Sep 19, 2019, 8:04:01 AM9/19/19
to simple...@googlegroups.com
Hi,

On 2019. 09. 19. 12:38, 'Jaime Pérez Crespo' via SimpleSAMLphp wrote:
>
> Well, of course :-)
>
> You are overriding the original template, so everything in the default one is now missing, including the SAML response and the javascript code that auto-submits it. Have a look at templates/post.php.
>

I feel really stupid now :)
It makes perfect sence. I found the templates/post.php, I will copy it
to mytheme/default/post.php and make my changes there. After that I'm
sure it'll work.

Thank you very much for fast and great support!

Cheers from Budapest,
Mikael

Peter Schober

unread,
Sep 19, 2019, 9:56:03 AM9/19/19
to noreply-spamdigest via SimpleSAMLphp
* 'Jaime Pérez Crespo' via SimpleSAMLphp <simple...@googlegroups.com> [2019-09-19 11:16]:
> You can create your own theme. Previously, this page in particular
> was hardcoded, but it’s not any longer, so you can override it with
> your own theme if you like:

May I suggest putting a simple statement along the lines of what the
OP suggested into the default version, even if one can override this
now in one's own theme?
-peter

Jaime Pérez Crespo

unread,
Oct 3, 2019, 3:47:49 AM10/3/19
to noreply-spamdigest via SimpleSAMLphp
Hi Peter,
That’s something I’ve considered several times, and so far I think it’s best not. That page is intended to be as light and fast as possible, so that ideally it’s never seen. Adding actual contents, with styling and so on, might make it load slower, enough to make it noticeable for the users.

In any case, I’m open to discussing this and doing some tests. Would you mind opening an issue in the issue tracker?

Peter Schober

unread,
Oct 3, 2019, 6:43:43 AM10/3/19
to noreply-spamdigest via SimpleSAMLphp
* 'Jaime Pérez Crespo' via SimpleSAMLphp <simple...@googlegroups.com> [2019-10-03 09:47]:
> That’s something I’ve considered several times, and so far I think
> it’s best not. That page is intended to be as light and fast as
> possible, so that ideally it’s never seen. Adding actual contents,
> with styling and so on, might make it load slower, enough to make it
> noticeable for the users.

Fair enough, though simple plain text without any styling would have
sufficed, IMHO. The larger issue with that is that an only momentarily
visible page may cause more confusion if people wanted to know what
just flickered across their screen and whether it was important.

So documenting how one would add such info to ones own templates is
probably the right way to deal with this after all.

-peter
Reply all
Reply to author
Forward
0 new messages