Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] oc login doesn't work without username oc login https://api.crc.testing:6443 #2032

Closed
praveenkumar opened this issue Mar 1, 2021 · 6 comments
Labels
kind/bug Something isn't working

Comments

@praveenkumar
Copy link
Member

It is happening with 4.7.0 bundles, works as expected with 4.6.x bundles.

$ oc login https://api.crc.testing:6443
The server uses a certificate signed by an unknown authority.
You can bypass the certificate check, but any data you send to the server could be intercepted by others.
Use insecure connections? (y/n): yes
You must obtain an API token by visiting https://oauth-openshift.apps-crc.testing/oauth/token/request
$ oc login https://api.crc.testing:6443 --v=9
[...]
I0301 15:30:29.226953 1480426 round_trippers.go:454]     Date: Mon, 01 Mar 2021 10:00:29 GMT
I0301 15:30:29.226983 1480426 multi.go:78] handler[0] error: did not receive username - print token url instead of basic prompt
I0301 15:30:29.226997 1480426 request_token.go:240] did not receive username - print token url instead of basic prompt
[...]
@guillaumerose
Copy link
Contributor

Apparently this was introduced in oc by openshift/oc#553

guillaumerose added a commit to guillaumerose/crc that referenced this issue Mar 1, 2021
This avoids the following error message when running oc login.

```
$ oc login https://api.crc.testing:6443
You must obtain an API token by visiting https://oauth-openshift.apps-crc.testing/oauth/token/request
```

OpenShift 4.7 introduced this. 4.6.16 was fine.

Related to crc-org#2032
cfergeau pushed a commit that referenced this issue Mar 1, 2021
This avoids the following error message when running oc login.

```
$ oc login https://api.crc.testing:6443
You must obtain an API token by visiting https://oauth-openshift.apps-crc.testing/oauth/token/request
```

OpenShift 4.7 introduced this. 4.6.16 was fine.

Related to #2032
@e-minguez
Copy link

Based on #2033 has been merged, I guess this can be closed, right? Thanks

@andreaskaris
Copy link

andreaskaris commented Apr 30, 2021

Did we make this change on purpose? It looks like it. If so, this is really confusing to our customer base. Also, our documentation is out of date atm: https://docs.openshift.com/container-platform/4.7/cli_reference/openshift_cli/getting-started-cli.html#cli-installing-cli_cli-developer-commands

What about changing the following message:

[quicklab@upi-0 ~]$ oc login --server=https://(...):6443 --insecure-skip-tls-verify=true
You must obtain an API token by visiting https://oauth-openshift.apps.(...)/oauth/token/request

At least to:

[quicklab@upi-0 ~]$ oc login --server=https://(...):6443 --insecure-skip-tls-verify=true
You must obtain an API token by visiting https://oauth-openshift.apps.(...)/oauth/token/request
If you wish to login via username and password, provide the --username <username> parameter

So that we spare our customers the step to open our documentation?

@guillaumerose
Copy link
Contributor

@andreaskaris I totally agree with your point. Your suggestion looks good. Maybe open a PR or an issue in the oc repo ?

@andreaskaris
Copy link

Done: openshift/oc#817

Sorry, I had not realized that this was the wrong repository :-)

@guillaumerose
Copy link
Contributor

The usage message is working in crc. We can't do much for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants