org.apache.sling.auth.core.AuthUtil isRedirectValid: Redirect target 'https://subdomain.company.com/registration-and-login.html' must not be an URL | Community
Skip to main content
bkkurian
October 17, 2022
Solved

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

  • October 17, 2022
  • 1 reply
  • 1385 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by rawvarun

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.

1 reply

rawvarun
Community Advisor
rawvarunCommunity AdvisorAccepted solution
Community Advisor
June 29, 2023

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.