Portal website not working when accessed via different domain externally
search cancel

Portal website not working when accessed via different domain externally

book

Article ID: 423807

calendar_today

Updated On:

Products

CA API Developer Portal

Issue/Introduction

After upgrading CA Portal from version 5.1.2 to 5.3.2, we found out that we are no longer able to login when accessing the website via external, publicly accessible URL that slightly differs from the internal Portal domain. Our current setup:


Internal URL: portal.live.ux.sample.com, where "portal" = TENANT_ID, "live.ux.sample.com" = PORTAL_DOMAIN
Public URL: apiportal.example.com

We have discovered that the website consists of javascripts that contain variations of the following code:


const tenantPrefix = window.location.hostname.split('.')[0];


that sets the tenantId according to the hostname. This approach works fine with the internal URL, however it cannot possibly work with the public one since the first part of the hostname does not contain TENANT_ID. In such case, the variables get "apiportal" assigned instead, resulting in malformed request URLs that break the main page,

 e. g.:

https://apiportal.example.com/api/apiportal/public/auth/schemes

https://apiportal.example.com/api/apiportal/branding/1.0/themes

Since the tenantId is actually "portal", the correct URLs should have looked like this:


https://apiportal.example.com/api/portal/public/auth/schemes

https://apiportal.example.com/api/portal/branding/1.0/themes

 

Environment

API Developer Portal 5.3.2

Resolution

Fix was added to API Developer Portal 5.3.2.1 which you can download for Solutions & Patches page.

API Developer Portal Installer Offline 5.3.2.1.tar.gz

Additional Information

Set the custom domain in CUSTOM_DOMAIN_NAME setting in order for Portal API page to work. You can use the Settings endpoint with a request body similar to this:

{
 "Name": "CUSTOM_DOMAIN_NAME",
 "Value": "mycustomdomain.com"
}