Search code examples
wso2wso2-api-manager

How to customize the hostname of the token endpoint shown in the devportal of WSO2 API Manager?


I've configured in deployment.toml the hostname of an Active-Active WSO2 API Manager cluster so each node is properly named: node1.cloud.client.com, node2.cloud.client.com.

Besides I've configured the https_endpoint for the API Gateway URL: gateway.cloud.client.com.

When I login to the developer portal console and access the Oauth2 tokens screen I see localhost:9443 as the token endpoint URL. How can I customize it to a proper hostname? Should it point to a node nodeX.cloud.client.com or the gateway gateway.cloud.client.com?

enter image description here


Solution

  • If you are using the resident KeyManager, this resides in the control plane and not in the gateway. Therefore please use the nodeX.cloud.client.com.

    There are two places that shows the token endpoint in the devportal.

    1. At the applications.
    2. At the API overview page

    You can customise both of them as you want.

    You can use the admin portal to update the token url shown at application view page by updating the resident key manager.

    1. Log in to admin portal (https://cp-host/admin)
    2. Select resident Key manager from keymanagers tab.
    3. Update the display token endpoint and revoke endpoint as you want.

    enter image description here

    You can change the token endpoint that is shown in the devportal API view by updating the deployment.toml file of the control plane.

    Please update the following section in you configuration with the appropriate token endpoint.

    [[apim.gateway.environment]]
    name = "Default"
    type = "hybrid"
    .
    .
    http_endpoint = "http://nodeX.cloud.client.com"
    https_endpoint = "https://nodeX.cloud.client.com"
    ..