ManagementApiBuilder.domain() builds an invalid URL when the domain includes https:// or a trailing slash
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 35/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Java
- Stelle
- 319
- Fork
- 156
- Merge medio
- 20h 46m
- PR unite (30g)
- 3
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di auth0/auth0-java
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
auth0/auth0-java#887 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
auth0/auth0-java#842 · 2 commenti ·
-
feature request
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
auth0/auth0-java#944 · 1 commento ·
-
bug
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
auth0/auth0-java#911 · 1 commento ·
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
auth0/auth0-java#897 ·
Tutte le issue di auth0/auth0-java
Issue simili
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
it-at-m/Wahllokalsystem#3846 ·
I maintainer di solito rispondono entro 2 giorni
-
Area/Connector module/solace Priority/Low Type/Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
ballerina-platform/ballerina-library#9849 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
Vakore/ZappierGames#327 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Radix number block generates NaN after switching a negative or decimal number to binary, octal or hexForse già presa @matthewalberto l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
mit-cml/appinventor-sources#4246 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno