ManagementApiBuilder.domain() builds an invalid URL when the domain includes https:// or a trailing slash
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start with ManagementApiBuilder.domain(...) and compare its URL construction with AuthAPI.newBuilder(...). Verify how domains containing https:// or a trailing slash are normalized, then add regression coverage for both forms. Done means the Management API, token, and default audience URLs use the expected https:// host and /api/v2 path without duplicated schemes or slashes.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
ManagementApi.builder().domain(...) always prepends https:// and appends /api/v2 to the value as given. If the domain already includes the scheme, or ends with a slash, the client is built with an invalid API URL, and the client credentials flow requests a token from an invalid URL with an invalid default audience.
AuthAPI.newBuilder(domain, ...) accepts both my-tenant.auth0.com and https://my-tenant.auth0.com, and so did ManagementAPI.newBuilder(domain, ...) in 2.x. Code that passes the same domain value to both clients, or that was migrated from 2.x, fails at request time.
Reproduction
ManagementApi mgmt = ManagementApi.builder()
.domain("https://my-tenant.auth0.com")
.clientCredentials("{CLIENT_ID}", "{CLIENT_SECRET}")
.build();
mgmt.users().list();
domain(...) value |
Management API URL | Token URL | Default audience |
|---|---|---|---|
https://my-tenant.auth0.com |
https://https://my-tenant.auth0.com/api/v2 |
https://https://my-tenant.auth0.com/oauth/token |
https://https://my-tenant.auth0.com/api/v2/ |
my-tenant.auth0.com/ |
https://my-tenant.auth0.com//api/v2 |
https://my-tenant.auth0.com/oauth/token |
https://my-tenant.auth0.com//api/v2/ |
In the first case, no request reaches the tenant. The second case requests a token for an audience that does not match the Management API identifier, and API calls go to a //api/v2 path.
Expected behavior
domain() accepts the domain with or without https:// and with or without a trailing slash, as AuthAPI does, and builds https://my-tenant.auth0.com/api/v2.
Environment
- auth0-java 5.4.0 (
mainat 484f9bb) - Java 8
- Ngôn ngữ chính
- Java
- Star
- 319
- Fork
- 156
- Merge trung bình
- 20 giờ 46 phút
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọ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 auth0/auth0-java
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
auth0/auth0-java#887 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
auth0/auth0-java#842 · 2 bình luận ·
-
feature request
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
auth0/auth0-java#944 · 1 bình luận ·
-
bug
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
auth0/auth0-java#911 · 1 bình luận ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
auth0/auth0-java#897 ·
Tất cả issue của auth0/auth0-java
Issue tương tự
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
it-at-m/Wahllokalsystem#3846 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Area/Connector module/solace Priority/Low Type/Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
ballerina-platform/ballerina-library#9849 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
Vakore/ZappierGames#327 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Radix number block generates NaN after switching a negative or decimal number to binary, octal or hexCó thể đã có người làm @matthewalberto đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
mit-cml/appinventor-sources#4246 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày