Skip to content

Commit 5d829b9

Browse files
committed
breaking: Remove the Management API support (#937)
1 parent 91ba5da commit 5d829b9

12 files changed

Lines changed: 23 additions & 1358 deletions

File tree

EXAMPLES.md

Lines changed: 0 additions & 226 deletions
Original file line numberDiff line numberDiff line change
@@ -3028,232 +3028,6 @@ params.put("screen_hint", "signup");
30283028
```
30293029
</details>
30303030

3031-
## Management API
3032-
3033-
The client provides a few methods to interact with the [Users Management API](https://auth0.com/docs/api/management/v2/#!/Users).
3034-
3035-
Create a new instance passing the account and an access token with the Management API audience and the right scope:
3036-
3037-
```kotlin
3038-
val users = UsersAPIClient(account, "api access token")
3039-
```
3040-
3041-
<details>
3042-
<summary>Using Java</summary>
3043-
3044-
```java
3045-
Auth0 account = Auth0.getInstance("client id", "domain");
3046-
UsersAPIClient users = new UsersAPIClient(account, "api token");
3047-
```
3048-
</details>
3049-
3050-
### Link users
3051-
3052-
```kotlin
3053-
users
3054-
.link("primary user id", "secondary user token")
3055-
.start(object: Callback<List<UserIdentity>, ManagementException> {
3056-
3057-
override fun onFailure(exception: ManagementException) { }
3058-
3059-
override fun onSuccess(identities: List<UserIdentity>) { }
3060-
})
3061-
```
3062-
3063-
<details>
3064-
<summary>Using coroutines</summary>
3065-
3066-
```kotlin
3067-
try {
3068-
val identities = users
3069-
.link("primary user id", "secondary user token")
3070-
.await()
3071-
println(identities)
3072-
} catch (e: ManagementException) {
3073-
e.printStacktrace()
3074-
}
3075-
```
3076-
</details>
3077-
3078-
<details>
3079-
<summary>Using Java</summary>
3080-
3081-
```java
3082-
users
3083-
.link("primary user id", "secondary user token")
3084-
.start(new Callback<List<UserIdentity>, ManagementException>() {
3085-
@Override
3086-
public void onSuccess(List<UserIdentity> payload) {
3087-
//Got the updated identities! Accounts linked.
3088-
}
3089-
3090-
@Override
3091-
public void onFailure(@NonNull ManagementException error) {
3092-
//Error!
3093-
}
3094-
});
3095-
```
3096-
</details>
3097-
3098-
### Unlink users
3099-
3100-
```kotlin
3101-
users
3102-
.unlink("primary user id", "secondary user id", "secondary provider")
3103-
.start(object: Callback<List<UserIdentity>, ManagementException> {
3104-
3105-
override fun onFailure(exception: ManagementException) { }
3106-
3107-
override fun onSuccess(identities: List<UserIdentity>) { }
3108-
})
3109-
```
3110-
3111-
<details>
3112-
<summary>Using coroutines</summary>
3113-
3114-
```kotlin
3115-
try {
3116-
val identities = users
3117-
.unlink("primary user id", "secondary user id", "secondary provider")
3118-
.await()
3119-
println(identities)
3120-
} catch (e: ManagementException) {
3121-
e.printStacktrace()
3122-
}
3123-
```
3124-
</details>
3125-
3126-
<details>
3127-
<summary>Using Java</summary>
3128-
3129-
```java
3130-
users
3131-
.unlink("primary user id", "secondary user id", "secondary provider")
3132-
.start(new Callback<List<UserIdentity>, ManagementException>() {
3133-
@Override
3134-
public void onSuccess(List<UserIdentity> payload) {
3135-
//Got the updated identities! Accounts linked.
3136-
}
3137-
3138-
@Override
3139-
public void onFailure(@NonNull ManagementException error) {
3140-
//Error!
3141-
}
3142-
});
3143-
```
3144-
</details>
3145-
3146-
### Get User Profile
3147-
3148-
```kotlin
3149-
users
3150-
.getProfile("user id")
3151-
.start(object: Callback<UserProfile, ManagementException> {
3152-
3153-
override fun onFailure(exception: ManagementException) { }
3154-
3155-
override fun onSuccess(identities: UserProfile) { }
3156-
})
3157-
```
3158-
3159-
<details>
3160-
<summary>Using coroutines</summary>
3161-
3162-
```kotlin
3163-
try {
3164-
val user = users
3165-
.getProfile("user id")
3166-
.await()
3167-
println(user)
3168-
} catch (e: ManagementException) {
3169-
e.printStacktrace()
3170-
}
3171-
```
3172-
</details>
3173-
3174-
<details>
3175-
<summary>Using Java</summary>
3176-
3177-
```java
3178-
users
3179-
.getProfile("user id")
3180-
.start(new Callback<UserProfile, ManagementException>() {
3181-
@Override
3182-
public void onSuccess(@Nullable UserProfile payload) {
3183-
//Profile received
3184-
}
3185-
3186-
@Override
3187-
public void onFailure(@NonNull ManagementException error) {
3188-
//Error!
3189-
}
3190-
});
3191-
```
3192-
</details>
3193-
3194-
### Update User Metadata
3195-
3196-
```kotlin
3197-
val metadata = mapOf(
3198-
"name" to listOf("My", "Name", "Is"),
3199-
"phoneNumber" to "1234567890"
3200-
)
3201-
3202-
users
3203-
.updateMetadata("user id", metadata)
3204-
.start(object: Callback<UserProfile, ManagementException> {
3205-
3206-
override fun onFailure(exception: ManagementException) { }
3207-
3208-
override fun onSuccess(identities: UserProfile) { }
3209-
})
3210-
```
3211-
3212-
<details>
3213-
<summary>Using coroutines</summary>
3214-
3215-
```kotlin
3216-
val metadata = mapOf(
3217-
"name" to listOf("My", "Name", "Is"),
3218-
"phoneNumber" to "1234567890"
3219-
)
3220-
3221-
try {
3222-
val user = users
3223-
.updateMetadata("user id", metadata)
3224-
.await()
3225-
println(user)
3226-
} catch (e: ManagementException) {
3227-
e.printStacktrace()
3228-
}
3229-
```
3230-
</details>
3231-
3232-
<details>
3233-
<summary>Using Java</summary>
3234-
3235-
```java
3236-
Map<String, Object> metadata = new HashMap<>();
3237-
metadata.put("name", Arrays.asList("My", "Name", "Is"));
3238-
metadata.put("phoneNumber", "1234567890");
3239-
3240-
users
3241-
.updateMetadata("user id", metadata)
3242-
.start(new Callback<UserProfile, ManagementException>() {
3243-
@Override
3244-
public void onSuccess(@Nullable UserProfile payload) {
3245-
//User Metadata updated
3246-
}
3247-
3248-
@Override
3249-
public void onFailure(@NonNull ManagementException error) {
3250-
//Error!
3251-
}
3252-
});
3253-
```
3254-
</details>
3255-
3256-
> In all the cases, the `user ID` parameter is the unique identifier of the auth0 account instance. i.e. in `google-oauth2|123456789` it would be the part after the '|' pipe: `123456789`.
32573031

32583032
## Token Validation
32593033
The ID token received as part of the authentication flow is should be verified following the [OpenID Connect specification](https://openid.net/specs/openid-connect-core-1_0.html).

V4_MIGRATION_GUIDE.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,20 @@ buildscript {
9696
- [signupWithPasskey()](auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.kt#L319-L344) -
9797
Sign up a user and returns a challenge for key generation
9898

99+
- The Management API support has been removed. This includes the `UsersAPIClient` class, `ManagementException`, and `ManagementCallback`.
100+
101+
> **Note:** This only impacts you if your app used the Management API client (`UsersAPIClient`).
102+
103+
**Impact:** Any code that references `UsersAPIClient`, `ManagementException`, or `ManagementCallback` will no longer compile.
104+
105+
**Migration:** Instead of calling the Management API directly from your mobile app, expose dedicated endpoints in your own backend that perform the required operations, and call those from the app using the access token you already have.
106+
107+
For example, if you were reading or updating user metadata:
108+
109+
1. Create a backend endpoint (e.g. `PATCH /me/metadata`) that accepts the operation your app needs.
110+
2. Call that endpoint from your app, passing the user's access token as a `Bearer` token in the `Authorization` header.
111+
3. On your backend, obtain a machine-to-machine token via the Client Credentials flow and use it to call the Management API with the precise scopes required.
112+
99113
### DPoP Configuration Moved to Builder
100114

101115
The `useDPoP(context: Context)` method has been moved from the `WebAuthProvider` object to the login

auth0/src/main/java/com/auth0/android/callback/ManagementCallback.kt

Lines changed: 0 additions & 5 deletions
This file was deleted.

auth0/src/main/java/com/auth0/android/management/ManagementException.kt

Lines changed: 0 additions & 90 deletions
This file was deleted.

0 commit comments

Comments
 (0)