Expand my Community achievements bar.

SOLVED

org.apache.sling.auth.core.AuthUtil isRedirectValid: Redirect target 'https://subdomain.company.com/registration-and-login.html' must not be an URL

Avatar

Level 1

When i try to use gated page it was redirecting properly but after adding below sling mapping configuration i am getting a warning and page is not redirecting to my login page.

 

org.apache.sling.auth.core.AuthUtil isRedirectValid: Redirect target 'https://subdomain.company.com/registration-and-login.html' must not be an URL

 

sling config

https://subdomain.company.com

 

<?xml version="1.0" encoding="UTF-8"?>
jcr:primaryType="sling:Mapping"
sling:internalRedirect="[/content/company/us/en]">
</jcr:root>
 

some one please help

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

It seems your URL is not valid.

 

Please see the following rules:

Returns true if the given redirect target is valid according to the following list of requirements:

  • The target is neither null nor an empty string
  • The target is not an URL which is identified by the character sequence :// separating the scheme from the host
  • The target is normalized such that it contains no consecutive slashes and no path segment contains a single or double dot
  • The target must be prefixed with the servlet context path
  • If a ResourceResolver is available as a request attribute the target (without the servlet context path prefix) must resolve to an existing resource
  • If a ResourceResolver is not available as a request attribute the target must be an absolute path starting with a slash character does not contain any of the characters <, >, ', or " in plain or URL encoding

If any of the conditions does not hold, the method returns false and logs a warning level message with the org.apache.sling.auth.core.AuthUtil logger.

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

It seems your URL is not valid.

 

Please see the following rules:

Returns true if the given redirect target is valid according to the following list of requirements:

  • The target is neither null nor an empty string
  • The target is not an URL which is identified by the character sequence :// separating the scheme from the host
  • The target is normalized such that it contains no consecutive slashes and no path segment contains a single or double dot
  • The target must be prefixed with the servlet context path
  • If a ResourceResolver is available as a request attribute the target (without the servlet context path prefix) must resolve to an existing resource
  • If a ResourceResolver is not available as a request attribute the target must be an absolute path starting with a slash character does not contain any of the characters <, >, ', or " in plain or URL encoding

If any of the conditions does not hold, the method returns false and logs a warning level message with the org.apache.sling.auth.core.AuthUtil logger.