This worked. https://www.latcoding.com/how-to-solve-kubernetes-dashboard-unauthorized-401-invalid-credentials-provided/
Solution 1: Migrating from kubectl proxy to kubectl port-forward. Add https at the beginning or you'll get 400 Bad Request error. i.e. https://localhost:8443/
Solution 2: Downgrade kubernetes dashboard version and keep using kubectl proxy
Credits to Author [Ambar Hasbiyatmoko].