openshift-online/ocm-cli

Add `cluster login` switch that generates direct url to "Copy Login Command"

Closed this issue · 2 comments

(Not sure if this is doable at all, but maybe.)

When we stopped using 2fa for cluster authentication, ocm cluster login became useless and the only way to actually get your oc connected is to cluster login --console, log in, click "Copy Login Command" in the upper right, log in again, then finally copy the oc login --token=… command into your CLI.

Maybe there's a way to skip a step there if it were possible to generate the "copy login command" magic url for a given cluster and redirect directly to that? So something like ocm cluster login --show-oc-login, log in once, copy oc login --token=…, done.

Yes this. There currently is no way to automate logging in on the cli since you have to open a browser and click around to get the login token.

Implemented by #136