wso2 / product-apim

Welcome to the WSO2 API Manager source code! For info on working with the WSO2 API Manager repository and contributing code, click the link below.
http://wso2.github.io/
Apache License 2.0
846 stars 785 forks source link

Authorization Redirect getting failed after customizing the Devportal URL per tenant #11755

Closed SupunTharakaSandaruwan closed 7 months ago

SupunTharakaSandaruwan commented 3 years ago

Description:

Once the Devportal URL is customized as guided in the [1], the Devportal UI can be accessed by the tenant-specific URL. However once tried to log in to the dev portal, it is getting failed with an internal 500 error, and can find the following trace in the wso2carbon.log file.

[2021-09-27 16:02:25,250] ERROR - WebAppManager org.mozilla.javascript.EvaluatorException: Can't find method java.lang.String.replace(org.mozilla.javascript.Undefined,string). (/devportal/services/utils.js#140)
org.jaggeryjs.scriptengine.exceptions.ScriptException: org.mozilla.javascript.EvaluatorException: Can't find method java.lang.String.replace(org.mozilla.javascript.Undefined,string). (/devportal/services/utils.js#140)
    at org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:587) ~[org.jaggeryjs.scriptengine_0.14.13.jar:?]
    at org.jaggeryjs.scriptengine.engine.RhinoEngine.exec(RhinoEngine.java:289) ~[org.jaggeryjs.scriptengine_0.14.13.jar:?]
    at org.jaggeryjs.jaggery.core.manager.WebAppManager.exec(WebAppManager.java:589) [org.jaggeryjs.jaggery.core_0.14.13.jar:?]
    at org.jaggeryjs.jaggery.core.manager.WebAppManager.execute(WebAppManager.java:508) [org.jaggeryjs.jaggery.core_0.14.13.jar:?]
    at org.jaggeryjs.jaggery.core.JaggeryServlet.doGet(JaggeryServlet.java:24) [org.jaggeryjs.jaggery.core_0.14.13.jar:?]
  ...
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_152]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_152]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat_9.0.31.wso2v1.jar:?]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_152]
Caused by: org.mozilla.javascript.EvaluatorException: Can't find method java.lang.String.replace(org.mozilla.javascript.Undefined,string). (/devportal/services/utils.js#140)
    ...
    at org.jaggeryjs.rhino.devportal.services.login.c1.exec(/devportal/services/login/login_callback.jag) ~[?:?]
    at org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:583) ~[org.jaggeryjs.scriptengine_0.14.13.jar:?]
    ... 50 more

Therefore, the same steps are given in [1]locally and could reproduce the issue in APIM 3.2.0.

Steps to reproduce:

Affected Product Version:

APIM 3.2.0

[1]https://apim.docs.wso2.com/en/3.2.0/develop/customizations/customize-the-api-store-and-gateway-urls-for-tenants/#customizing-the-developer-portal-and-gateway-urls-for-tenants

tharindu1st commented 7 months ago

Invalid due to jaggeryjs not available in latest ui