Contact usRequest a demo

Managing redirects in Unblu

Unblu has three different ways of handling redirects:

  • The Unblu redirect mechanism for relative URLs.

  • Filtered redirects.

  • Redirects determined solely by configuration properties and URL query parameters.

Which method is applied to a redirect depends on the particular type of redirect. This article describes when Unblu applies which method.

Unblu redirect mechanism for relative URLs

Unblu provides a general mechanism for server-side redirects to relative URLs. This makes it easier to configure different environments—​for example testing, staging, and production environments—​because you only have to make changes to a small set of configuration properties rather than adapt numerous redirect target URLs.

To use Unblu’s redirect handling mechanism, set com.unblu.server.core.redirect.useUnbluRedirectHandling to true. You can then use the following configuration properties to define the redirect target:

  • com.unblu.server.core.redirect.scheme specifies the scheme used for the redirect, for example HTTP or HTTPS.

  • com.unblu.server.core.redirect.serverName specifies the name of the server the client is redirected to.

  • com.unblu.server.core.redirect.port specifies the port of the server the client is redirected to.

The Unblu redirect mechanism also applies to any relative URLs you define in the following configuration properties:

For further information on these properties, please refer to their respective entries in the configuration properties reference.

Filtered redirects

Unblu checks the target of certain redirects against a blacklist and whitelist. The blacklist and whitelist consist of regular expressions that the target is compared with. They are defined in the following configuration properties:

The values of the properties are always treated as regular expressions. For example, will also match https://wwwXunbluYcom.

The redirect targets passed in are always evaluated against both lists. The configuration property com.unblu.redirectFilter.order defines the order in which to check the blacklist and whitelist.

Unblu checks redirect targets against the redirect blacklist and whitelist in the following cases:

  • If the user’s locale is set by the locale servlet and the URL includes a redirect query parameter with an absolute URL, for example /unblu/language?action="set"&lang="de"&redirect="".

  • If the redirect occurs after an authentication action, that is, after a login or logout.

  • If a call to the web API endpoint authenticator/authenticateWithToken includes the query parameter redirectOnSuccess with an absolute URL.

URLs are also checked against the blacklist and whitelist for the following redirects used in the Single Conversation Desk and the Visitor Desk, respectively:

Example of redirect filter configuration

To see how the redirect filters work, suppose you’ve configured the redirect filter with the following values:

  1. The first configuration property ensures that the blacklist is evaluated before the whitelist.

  2. The blacklist matches all strings, essentially blocking all redirect targets.

  3. The whitelist is evaluated after the blacklist. It specifies that subdomains of using the HTTPS scheme are permissible redirect targets.

Redirect configuration properties

There are a number of configuration properties you can use to configure redirect targets. These configuration properties aren’t affected by either the Unblu redirect mechanism or the redirect filters:

  • config:com.unblu.agent.singleconversation.desk.conversationJoinFailedRedirectUrl and the query parameter redirectOnFailure that overrides it.

  • config:com.unblu.visitor.desk.conversationJoinFailedRedirectUrl and the query parameter redirectOnFailure that overrides it.

  • com.unblu.entry-servlet.externalLoginUrl.

  • com.unblu.core.client.core.LoginConfiguration.externalPostLogoutUrl.

Refer to the respective entries in the configuration properties reference for further information.