162
Views
6
Comments
Solved
[IdPReact] redirect issue on production environment with SEO Urls (Site Rules)
idp-react
Reactive icon
Forge asset by Telmo Martins
Application Type
Reactive

HI!

We use IdPReact for a couple of our apps. We have configured it for these apps and it works as expected in both the development and testing environment.

But in production the application gets redirected to a blank page.

When we click in the address bar of the browser and hit enter it continues and does the login as expected.

We've been trying to fix this issue but since it works just fine in dev and test this has been  very tedious.

The main thing we think might be causing this is that on production we use SEO Friendly URLs - Site Rules for our apps.

Is there anyone here who's had something similar and/or has a (possible) solution we can try?

Thanks!

2019-04-08 14-35-40
Nils Nahooy
Solution

For future reference, below is the response I've received from Outsystems support. We've tested their proposed workaround 2 and it worked in being a successful workaround.

Hi Nils,

According to the reported misbehavior, we believe that you are affected by a known issue that is still being investigated, RPM-2160. 

It was found that when a Site Rule associates the hostname of the environment without any subpath (e.g., hostname/home/) to a Reactive app, any redirects to another app (reactive or traditional) will load a blank page. Refreshing the page successfully loads the second application.

Currently, this problem hasn't been addressed yet. Nevertheless, there are several possible workarounds that you may try to see if they are successful for your specific use case. These include:

  1. Change the Site Rule so that it includes a subpath. In your case, and since you have several Site Rules for different applications, we don't believe this is the best option. Furthermore, this workaround is usually not applicable since it defeats the purpose of having the hostname pointing to a specific application;
  2. Instead of using a RedirectURL in the main reactive application, use a Javascript node to redirect to the second application (in your case, from what we could see, that is usually the IdP module). For example, focusing on the 'DuvelTimeRegBO' module, you would need to replace the RedirectToURL node in the 'OnDataReady' action of the 'Common/Login' screen with a Javascript node instead. The Javascript would be a simple document.location.href=$parameters.Destination accepting as the Input parameter the 'URL' variable that you were passing in the 'RedirectToURL'.

Please note that, in some cases, this workaround caused an error screen so please test this in Development by creating an SEO rule similar to the one used in Production.

3. Create a dummy Traditional web application that does the redirection to the reactive modules where the issue is occurring and point the Site rule to the traditional app instead. The Traditional web app should contain just an anonymous access screen with the Preparation doing a basic redirect with an ExternalURL to the Reactive modules (e.g., URL = "DuvelTimeRegBO"):

 

The Site rule should then point to this new traditional web module, instead of the Reactive 'DuvelTimeRegBO' module:

 

We hope this information was clear. Please let us know if you were able to successfully implement one of the provided workarounds.

Thank you for your understanding and collaboration. 

2021-02-25 10-16-25
Wouter Verbeeck

Hi, 

It is possible we have the same or a similar issue, making use of a different sub-domain within the production environment.

When setting up a different SamlApp, a parameter pointig to this different SamlApp should be populated. 

In idP you have the possibility to do so. This parameter is not present in the idPReact application. We are going to try out having this parameter and populating it from a site property.

IF not the same context, I'm happy to learn from your findings.


Kind regards,

Wouter

20220927-IdPReact-ParameterForward-to-idP.png
2019-04-08 14-35-40
Nils Nahooy

Hi Wouter,

Thanks for your reply, we'll have a look at your proposed solution and post our findings here.

Groeten,

Nils

2021-02-25 10-16-25
Wouter Verbeeck

For our issue it worked. We can now logon from the different subdomain.

2019-04-08 14-35-40
Nils Nahooy

Hi Wouter, 

It seems we're using different versions of the module as the server action IdP_GetLoginUrl is deprecated in the version we have, and does not seem to be used anywhere anymore.

I did however notice this parameter being present in the client action GetLoginURL and being pased to the server action IdP_SSO_URL.

Which makes me think that the issue you guys were having has since been fixed in a later version of the module.

I'm however unsure as to how we should now use this parameter, i.e. what info should we set in the Site Property you spoke of?

2021-02-25 10-16-25
Wouter Verbeeck

So as we briefly discussed in a private call, the issue doesn't necessarily as to do with IdP, but could be caused by an issue with SEO site rules redirect when redirecting to an app and not to the app link.

i.e.

I want to go to "MyApp" on "sub.company.com"

I have a site rule stating sub.company.com directs to MyApp

in this case the issue is present.

When opening the app from sub.company.com/MyApp the issue seems not te be there.


A ticket is logged at OutSystems for this.

2019-04-08 14-35-40
Nils Nahooy
Solution

For future reference, below is the response I've received from Outsystems support. We've tested their proposed workaround 2 and it worked in being a successful workaround.

Hi Nils,

According to the reported misbehavior, we believe that you are affected by a known issue that is still being investigated, RPM-2160. 

It was found that when a Site Rule associates the hostname of the environment without any subpath (e.g., hostname/home/) to a Reactive app, any redirects to another app (reactive or traditional) will load a blank page. Refreshing the page successfully loads the second application.

Currently, this problem hasn't been addressed yet. Nevertheless, there are several possible workarounds that you may try to see if they are successful for your specific use case. These include:

  1. Change the Site Rule so that it includes a subpath. In your case, and since you have several Site Rules for different applications, we don't believe this is the best option. Furthermore, this workaround is usually not applicable since it defeats the purpose of having the hostname pointing to a specific application;
  2. Instead of using a RedirectURL in the main reactive application, use a Javascript node to redirect to the second application (in your case, from what we could see, that is usually the IdP module). For example, focusing on the 'DuvelTimeRegBO' module, you would need to replace the RedirectToURL node in the 'OnDataReady' action of the 'Common/Login' screen with a Javascript node instead. The Javascript would be a simple document.location.href=$parameters.Destination accepting as the Input parameter the 'URL' variable that you were passing in the 'RedirectToURL'.

Please note that, in some cases, this workaround caused an error screen so please test this in Development by creating an SEO rule similar to the one used in Production.

3. Create a dummy Traditional web application that does the redirection to the reactive modules where the issue is occurring and point the Site rule to the traditional app instead. The Traditional web app should contain just an anonymous access screen with the Preparation doing a basic redirect with an ExternalURL to the Reactive modules (e.g., URL = "DuvelTimeRegBO"):

 

The Site rule should then point to this new traditional web module, instead of the Reactive 'DuvelTimeRegBO' module:

 

We hope this information was clear. Please let us know if you were able to successfully implement one of the provided workarounds.

Thank you for your understanding and collaboration. 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.