diff --git a/EXAMPLES.md b/EXAMPLES.md index a6bb1a615..12e2e4bca 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -43,6 +43,7 @@ - [Enroll a Recovery Code](#enroll-a-recovery-code) - [Verify an Enrollment](#verify-an-enrollment) - [Delete an Authentication Method](#delete-an-authentication-method) + - [Update an Authentication Method](#update-an-authentication-method) - [Credentials Manager](#credentials-manager) - [Secure Credentials Manager](#secure-credentials-manager) - [Usage](#usage) @@ -2239,6 +2240,42 @@ myAccountClient.deleteAuthenticationMethod("phone|dev_...") + +### Update an Authentication Method +**Scopes required:** `update:me:authentication_methods` + +Updates a single authentication method. + +**Prerequisites:** + +The user must have the specific authentication method (identified by its ID) already enrolled. + +```kotlin +myAccountClient.updateAuthenticationMethodById("{Authentication_Id}", "{Name}") + .start(object : Callback { + override fun onSuccess(result: Unit) { + // Deletion successful + } + override fun onFailure(error: MyAccountException) { } + }) +``` +
+ Using Java + +```java +myAccountClient.updateAuthenticationMethodById("{Authentication_Id}", "{Name}") + .start(new Callback() { + @Override + public void onSuccess(Void result) { + // Deletion successful + } + @Override + public void onFailure(@NonNull MyAccountException error) { } + }); +``` +
+ + ## Credentials Manager ### Secure Credentials Manager diff --git a/auth0/src/main/java/com/auth0/android/myaccount/MyAccountAPIClient.kt b/auth0/src/main/java/com/auth0/android/myaccount/MyAccountAPIClient.kt index a8b9447c7..0a71b1f66 100644 --- a/auth0/src/main/java/com/auth0/android/myaccount/MyAccountAPIClient.kt +++ b/auth0/src/main/java/com/auth0/android/myaccount/MyAccountAPIClient.kt @@ -364,13 +364,13 @@ public class MyAccountAPIClient @VisibleForTesting(otherwise = VisibleForTesting * }) * ``` * - * @param authenticationMethodId Id of the authentication method to be retrieved + * @param authenticationMethodId Id of the authentication method to be updated * @param authenticationMethodName The friendly name of the authentication method * @param preferredAuthenticationMethod The preferred authentication method for the user. (for phone authenticators) * */ @JvmOverloads - internal fun updateAuthenticationMethodById( + public fun updateAuthenticationMethodById( authenticationMethodId: String, authenticationMethodName: String? = null, preferredAuthenticationMethod: PhoneAuthenticationMethodType? = null