Unable to read Kubernetes API from the endpoint

Hi Team,
We are trying to read the kubernetes API from the endpoint exposed by kubernetes master at https://<rancher_IP>:8080/r/projects/1a9/kubernetes:6443/api/v1

we have set up the local authentication on Rancher server. So when we try to run the above it takes to the rancher login screen. We tried generating the API key and secret for the specified user however that also works if the user session is active in the browser.

https://<rancher_IP>:8080/r/projects/1a9/kubernetes:6443/api/?Username=<secret_KEY_Username>&Password=<Secret_Password>

How do we make the authentication work so that i can login and read the API’s.
Thanks.