wso2 / kubernetes-apim

Kubernetes and Helm resources for WSO2 API Manager
Apache License 2.0
114 stars 216 forks source link

Login redirect always points to am.wso2.com #570

Open wian-plus opened 1 year ago

wian-plus commented 1 year ago

Description:

After a fresh install following Single Node Deployment using Kubernetes Helm, we set up our own DNS as follows: am.<OUR DOMAIN> ---> <EXTERNAL-IP> gateway.am.<OUR DOMAIN> ---> <EXTERNAL-IP> websub.am.<OUR DOMAIN> ---> <EXTERNAL-IP>

There are no entries in the /etc/host file, as we are using our own domain.

An example of how we updated the Ingress for wso2am-single-node-am-ingress is shown below:

Screenshot 2023-02-23 at 17 20 00

We did the same for wso2am-single-node-am-gateway-ingress and wso2am-single-node-am-websub-ingress and respectively updated the host values to gateway.am.<OUR DOMAIN> and websub.am.<OUR DOMAIN>.

Thereafter, we navigate to am.<OUR DOMAIN>/publisher. We get a brief message "You will be redirected to /publisher/services/auth/login", and there after we are redirected to https://am.wso2.com/oauth2/authorize<OTHER PARAMS>&redirect_uri=https://am.wso2.com/publisher/services/auth/callback/login

As you can see, the host is am.wso2.com which will fail to resolve. Another issue is that the redirect_uri also contains am.wso2.com as a host. How and where can we set this to be am.<OUR DOMAIN>.

If we manually change the redirect in the browser to https://am.<OUR DOMAIN>/oauth2/authorize<OTHER PARAMS>&redirect_uri=https://am.wso2.com/publisher/services/auth/callback/login, it will give us access after 2 to 3 refreshes, but that is extremely hackey.

Suggested Labels: Login, redirect, first time setup, domain

Affected Product Version: version 4.1.0-1

OS, DB, other environment details and versions: AWS EKS (Kubernetes 1.24) Helm V3 Macbook Pro M2 MacOS Ventura 13.0.1 (22A400)

Steps to reproduce: See above

nniksa91 commented 1 year ago

Hostnames should be set up inside values file each section has it's own hostname if you changed them in ingress it will be overrided by values.yaml which default to the one you mentioned