Token authentication for influx1.8 not working?
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- authentication, databases
Hướng nghiên cứu
Bắt đầu với điểm truy cập InfluxDBClient bằng cách sử dụng tham số token và tái hiện phản hồi 401 đối với InfluxDB 1.8.2 hoặc 1.8.3 bằng JWT được cung cấp và cả hai dạng token. So sánh yêu cầu xác thực của client V2 với thông tin xác thực mà máy chủ mong đợi; hoàn tất khi cách sử dụng được hỗ trợ hoặc tính không tương thích được xác nhận và hành vi được sửa hoặc ghi lại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Specifications
- Client Version: 1.35.0
- InfluxDB Version: 1.8.2
- Platform: Ubuntu 20.04.5 LTS
Code sample to reproduce problem
client = InfluxDBClient(
url=influx_url,
verify_ssl=False,
token=influx_token,
debug=True
)
where influx_token is jwt token in string format. example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiZXhwIjoxNzAxODIwODAwfQ.LraKXlamiE9pr0owDgSdDt3FMKR3pVNolLVxm4ULG-8"
Used following payload when generating jwt:
{
"username": "admin",
"exp": 1701820800
}
Expected behavior
Should authenticate using token in V2 client. Use of same token in V1 python client works fine. Am I missing something required to parse the token before feeding it to the InfluxDBClient instantiation in V2 python client?
Actual behavior
I receive a parsing error for the token authentication:
[2023-01-06 16:23:27,933] [7642] [ERROR] [influx_connector.py:154] InfluxDB Error: (401)
Reason: Unauthorized
HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json', 'Request-Id': 'be28dbc8-8e10-11ed-800a-0242ac130003', 'Www-Authenticate': 'Basic realm="InfluxDB"', 'X-Influxdb-Build': 'OSS', 'X-Influxdb-Version': '1.8.3', 'X-Request-Id': 'be28dbc8-8e10-11ed-800a-0242ac130003', 'Date': 'Fri, 06 Jan 2023 22:23:27 GMT', 'Content-Length': '55'})
HTTP response body: b'{"error":"unable to parse authentication credentials"}\n'
Additional info
If I change how I feed the token parameter to something like below, the error changes to:
Reason: Unauthorized
HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json', 'Request-Id': '64052e35-8e0d-11ed-8032-0242ac130003', 'Www-Authenticate': 'Basic realm="InfluxDB"', 'X-Influxdb-Build': 'OSS', 'X-Influxdb-Version': '1.8.3', 'X-Request-Id': '64052e35-8e0d-11ed-8032-0242ac130003', 'Date': 'Fri, 06 Jan 2023 21:59:28 GMT', 'Content-Length': '33'})
HTTP response body: b'{"error":"authorization failed"}\n
This leads me to believe something more than just passing the token itself as a string is the problem I'm having. Are there other parameters required when using the token. Do I need to add/edit something to the token string itself?
client = InfluxDBClient(
url=influx_url,
verify_ssl=False,
token=f'{influx_user}:{influx_token}',
debug=True
)
- Ngôn ngữ chính
- Python
- Star
- 792
- Fork
- 186
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của influxdata/influxdb-client-python
-
Pandas outputs warning when calling dataframe.append in flux_csv_parser._prepare_data_frameCó thể đã có người làm @dave-cz đã nhận 406 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
influxdata/influxdb-client-python#613 · 7 bình luận ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
-
Public symbols not properly exported with `py.typed` present — triggers Pylance/Pyright errorsĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
influxdata/influxdb-client-python#694 · 6 reaction ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 30/100
influxdata/influxdb-client-python#693 · 2 bình luận · 1 reaction ·
-
Socks proxy supportĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Tất cả issue của influxdata/influxdb-client-python
Issue tương tự
-
Add `django-upgrade` to the CIĐang mởdependencies feature github_actions good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
wemake-services/wemake-django-template#3149 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[request] vsg/1.1.16Đang mởupstream update
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
conan-io/conan-center-index#31142 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:core bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
request-theme
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 70/100
LizardByte/ThemerrDB#8877 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/install-update comp/gateway P0 sweeper:risk-compatibility type/bug
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 72/100
NousResearch/hermes-agent#135997 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày