Bug 1955344 - "oc login" no longer works as expected in the "oc" cli 4.7 version
Summary: "oc login" no longer works as expected in the "oc" cli 4.7 version
Keywords:
Status: CLOSED DUPLICATE of bug 1939403
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.7
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.8.0
Assignee: Maciej Szulik
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-04-29 22:05 UTC by harsharm
Modified: 2024-12-20 19:59 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-06-08 14:44:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description harsharm 2021-04-29 22:05:02 UTC
Description of problem:
If you type "oc login https:....." you will get:

oc login https://api.cluster-XXX.sandboxXXX.opentlc.com: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): y

You must obtain an API token by visiting https://oauth-openshift.apps.cluster-XXX.sandboxXXX.opentlc.com/oauth/token/request

Instead, you must type:

oc login --username=NAMEOFUSER https://api.cluster-XXX.sandboxXXX.opentlc.com:6443

Example:

oc login --username=NAMEOFUSER https://api.cluster-XXX.sandboxXXX.opentlc.com: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): y 
Authentication required for https://api.cluster-XXX.sandboxXXX.opentlc.com:6443 (openshift)
Username: NAMEOFUSER
Password: 

The message presented to user after entering the oc login, dose not inform users to use -u option instead presents them with message to obtain an API token, this could be misleading for users.


Version-Release number of selected component (if applicable):
"oc" cli 4.7 version

How reproducible:
Always

Steps to Reproduce:
1. oc login 

Actual results:
When trying to login as normal to ocp via cli, message to obtain an API token is presented to users, and this gives no hints to users to use the -u option to be able to login as normal. Users need to look for --help or the documentation for login, Which may spoil the user experience. 

Expected results:
oc login to work as expected or provide any hints about using the -u option along with the message to obtain an API token.

Additional info:

Comment 1 Maciej Szulik 2021-06-08 14:44:35 UTC
The change was intentional, I'm planning to fix only the LDAP bits, if possible, see the duplicate BZ.

*** This bug has been marked as a duplicate of bug 1939403 ***


Note You need to log in before you can comment on or make changes to this bug.