Show message while SAML IDP redirects an user to the SP

Problem this snippet solves:

When an user gets redirected from a BIG-IP IDP to a SP the browser may display a white screen when the SP isn't responding right away. This happens when for example the SP needs some time to perform some user lookups or is just slow.

This code snippet will alter the blank page and put a message on it. See the example below.

Besides a message, you can also choose to display a CSS Loader. For more information on these CSS Loaders see:

http://cfoucht.com/loadlab/

How to use this snippet:

Create a new Virtual Server that will act as the IDP frontend. This Virtual Server will need a STREAM profile and the iRule below. This additional Virtual Server is needed to be able to modify the HTTP response of the Virtual Server that holds the Access Policy.

Code :

when RULE_INIT {
    # select one of the CSS Loaders
    # 
    # These CSS Loaders are created by Camden Foucht
    # See: https://github.com/CamdenFoucht/LoadLab
    
    #set static::saml_redirect_html { 
} #set static::saml_redirect_html {
} #set static::saml_redirect_html {
} #set static::saml_redirect_html {
} #set static::saml_redirect_html {
} #set static::saml_redirect_html {
} #set static::saml_redirect_html {
} #set static::saml_redirect_html {
} set static::saml_redirect_html {
} #set static::saml_redirect_html {
#
#
#
#
} #set static::saml_redirect_html {
#
#
} #set static::saml_redirect_html {
} #set static::saml_redirect_html {
} #set static::saml_redirect_html {
#
} #set static::saml_redirect_html {
} #set static::saml_redirect_html {
} # you can also display a message. #set static::saml_redirect_html {

Please wait while you are being redirected...

} set static::saml_redirect_css {} } when CLIENT_ACCEPTED { virtual vs_idp_example_com } when HTTP_REQUEST { set match 0 STREAM::disable HTTP::header remove "Accept-Encoding" if { [HTTP::uri] starts_with "/saml/idp/profile/redirectorpost/sso" } { set match 1 } } when HTTP_RESPONSE { if { $match } { STREAM::expression "@$static::saml_redirect_html
Published Sep 14, 2018
Version 1.0

Was this article helpful?

7 Comments