How to login to Rancher through API? (with AAD integration)

Hey guys,

I am trying to login to retrieve the cattle key & accesses so that I can retrieve the Kubeconfig through API.

I’ve been trying to login to Rancher (integrated with AAD) through the API endpoint at /v3-public/azureADProviders/azuread?action=login, but I keep getting the 500 error.

Appreciate your help in advance.