[Bug]: errror message when using http urls for OIDC providers is missleading

Đang mở
#1,216 5 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@dopey đang làm issue này rồi.

Từ ngày 25/6/2024.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

bug needs triage
Steps to Reproduce

Setup up OIDC provider with a HTTP URL and try and use it to issue a new SSH certificate

e.g. follow these instructions (but do not enable HTTPS for Keycloak)

The error message on the line after this test for the URL not starting with https:// only mentions github/google not the real reason

https://github.com/smallstep/cli/blob/e6c5f218f0b13699a328a937f02b9de0907e1654/command/oauth/cmd.go#L330

Your Environment
  • OS - linux (Fedor and Ubuntu)
  • step CLI Version - Smallstep CLI/0.23.0 (linux/amd64), Release Date: 2022-11-12T00:00:59Z
Expected Behavior

The error message mention that the URL provided is not https

Actual Behavior
$ step ssh login --issuer=keycloak [email protected]
✔ Provisioner: keycloak (OIDC) [client: step-ca]
use a valid provider: google or github
error running: step oauth --oidc --bare --provider http://keycloak.k8s.loc/realms/xxxxx/.well-known/openid-configuration --client-id step-ca --client-secret 0OLuF5LOrP3dYQXzgxxxxxxxxxxxxxx --listen :10000: exit status 1

This error message is less than helpful, but a at least it gave me the command that failed...

$ step oauth --oidc --bare --provider http://keycloak.k8s.loc/realms/xxxxx/.well-known/openid-configuration --client-id step-ca --client-secret 0OLuF5LOrP3dYQXzgxxxxxxxxxxxxxx  --listen :10000
use a valid provider: google or github
Additional Context

Yes I know I can use smallstep ca to issue a cert for keycloak, but it was already up and running without when I ran the test and it was lucky that googling the error message took me to the code and I could understand what the error actually meant by reading the test that triggered it

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

Ngôn ngữ chính
Go
Star
4.3k
Fork
320
Merge trung bình
2 ngày 3 giờ
Pull request đã merge (30 ngày)
11

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của smallstep/cli

Tất cả issue của smallstep/cli

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.