ManagementApiBuilder.domain() builds an invalid URL when the domain includes https:// or a trailing slash

未關閉
#945 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

@RaphaelFakhri 已經在處理了。

開始於 2026年10月17日。

  • #946 來自 @RaphaelFakhri —— 未關閉

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
停滯
技術堆疊
java
領域
api

研究方向

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.

由索引模型根據 Issue 內容生成。

描述

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 (main at 484f9bb)
  • Java 8
主要語言
Java
星號
319
分支
156
平均合併
20 小時 46 分鐘
30 天內合併 PR
3

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

auth0/auth0-java 的其他 Issue

查看 auth0/auth0-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。