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

Login message not shown when login redirects #17150

Closed
smarterclayton opened this issue Nov 2, 2017 · 1 comment
Closed

Login message not shown when login redirects #17150

smarterclayton opened this issue Nov 2, 2017 · 1 comment
Assignees
Labels
area/security component/cli kind/bug Categorizes issue or PR as related to a bug. priority/P1
Milestone

Comments

@smarterclayton
Copy link
Contributor

$ oc login
error: not authorized - verify you have provided the correct host and port and that the server is currently running.
$ oc login https://api.ci.openshift.org
error: not authorized - verify you have provided the correct host and port and that the server is currently running.
$ oc login https://api.ci.openshift.org --loglevel=8
I1102 12:08:36.986805   23425 loader.go:357] Config loaded from file /Users/clayton/.kube/ci.kubeconfig
I1102 12:08:36.988795   23425 round_trippers.go:383] HEAD https://api.ci.openshift.org:443/
I1102 12:08:36.988812   23425 round_trippers.go:390] Request Headers:
I1102 12:08:37.268003   23425 round_trippers.go:408] Response Status: 403 Forbidden in 279 milliseconds
I1102 12:08:37.268033   23425 round_trippers.go:411] Response Headers:
I1102 12:08:37.268042   23425 round_trippers.go:414]     Cache-Control: no-store
I1102 12:08:37.268048   23425 round_trippers.go:414]     Content-Type: application/json
I1102 12:08:37.268054   23425 round_trippers.go:414]     Content-Length: 210
I1102 12:08:37.268060   23425 round_trippers.go:414]     Date: Thu, 02 Nov 2017 16:08:36 GMT
I1102 12:08:37.268120   23425 round_trippers.go:383] GET https://api.ci.openshift.org:443/.well-known/oauth-authorization-server
I1102 12:08:37.268131   23425 round_trippers.go:390] Request Headers:
I1102 12:08:37.268138   23425 round_trippers.go:393]     X-Csrf-Token: 1
I1102 12:08:37.307328   23425 round_trippers.go:408] Response Status: 200 OK in 39 milliseconds
I1102 12:08:37.307350   23425 round_trippers.go:411] Response Headers:
I1102 12:08:37.307358   23425 round_trippers.go:414]     Cache-Control: no-store
I1102 12:08:37.307365   23425 round_trippers.go:414]     Content-Type: application/json
I1102 12:08:37.307371   23425 round_trippers.go:414]     Content-Length: 537
I1102 12:08:37.307376   23425 round_trippers.go:414]     Date: Thu, 02 Nov 2017 16:08:36 GMT
I1102 12:08:37.307695   23425 round_trippers.go:383] GET https://api.ci.openshift.org/oauth/authorize?client_id=openshift-challenging-client&code_challenge=RWFVZmloLyP3MF2LITayUtFNfYKiqRXKuZbJLNfoqI0&code_challenge_method=S256&redirect_uri=https%3A%2F%2Fapi.ci.openshift.org%2Foauth%2Ftoken%2Fimplicit&response_type=code
I1102 12:08:37.307709   23425 round_trippers.go:390] Request Headers:
I1102 12:08:37.307715   23425 round_trippers.go:393]     X-Csrf-Token: 1
I1102 12:08:37.349737   23425 round_trippers.go:408] Response Status: 401 Unauthorized in 42 milliseconds
I1102 12:08:37.349759   23425 round_trippers.go:411] Response Headers:
I1102 12:08:37.349767   23425 round_trippers.go:414]     Link: <https://api.ci.openshift.org/oauth/token/request>; rel="related"
I1102 12:08:37.349774   23425 round_trippers.go:414]     Warning: 199 Origin "You must obtain an API token by visiting https://api.ci.openshift.org/oauth/token/request"
I1102 12:08:37.349781   23425 round_trippers.go:414]     Content-Type: text/plain; charset=utf-8
I1102 12:08:37.349786   23425 round_trippers.go:414]     Content-Length: 90
I1102 12:08:37.349791   23425 round_trippers.go:414]     Date: Thu, 02 Nov 2017 16:08:36 GMT
F1102 12:08:37.350452   23425 helpers.go:120] error: not authorized - verify you have provided the correct host and port and that the server is currently running.

Should have printed the warning. Regression @openshift/sig-security

@enj
Copy link
Contributor

enj commented Nov 2, 2017

Duplicate of #17136 being fixed in #17138

@juanvallejo please confirm and add a test.

@pweil- pweil- added component/cli kind/bug Categorizes issue or PR as related to a bug. labels Nov 2, 2017
openshift-merge-robot added a commit that referenced this issue Nov 4, 2017
…-loginoptions

Automatic merge from submit-queue (batch tested with PRs 17178, 17141, 17138).

preserve err type loginoptions

Fixes #17136
Fixes #17150

Preserves the error  type returned in https://github.com/openshift/origin/blob/master/pkg/oc/cli/cmd/login/loginoptions.go#L237

cc @openshift/cli-review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/security component/cli kind/bug Categorizes issue or PR as related to a bug. priority/P1
Projects
None yet
Development

No branches or pull requests

4 participants