Skip to content

Commit 5c371a5

Browse files
authored
refactor : Made the updateAuthenticationMethodById public (#948)
1 parent d4fa009 commit 5c371a5

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

EXAMPLES.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
- [Enroll a Recovery Code](#enroll-a-recovery-code)
4444
- [Verify an Enrollment](#verify-an-enrollment)
4545
- [Delete an Authentication Method](#delete-an-authentication-method)
46+
- [Update an Authentication Method](#update-an-authentication-method)
4647
- [Credentials Manager](#credentials-manager)
4748
- [Secure Credentials Manager](#secure-credentials-manager)
4849
- [Usage](#usage)
@@ -2239,6 +2240,42 @@ myAccountClient.deleteAuthenticationMethod("phone|dev_...")
22392240
</details>
22402241

22412242

2243+
2244+
### Update an Authentication Method
2245+
**Scopes required:** `update:me:authentication_methods`
2246+
2247+
Updates a single authentication method.
2248+
2249+
**Prerequisites:**
2250+
2251+
The user must have the specific authentication method (identified by its ID) already enrolled.
2252+
2253+
```kotlin
2254+
myAccountClient.updateAuthenticationMethodById("{Authentication_Id}", "{Name}")
2255+
.start(object : Callback<Unit, MyAccountException> {
2256+
override fun onSuccess(result: Unit) {
2257+
// Deletion successful
2258+
}
2259+
override fun onFailure(error: MyAccountException) { }
2260+
})
2261+
```
2262+
<details>
2263+
<summary>Using Java</summary>
2264+
2265+
```java
2266+
myAccountClient.updateAuthenticationMethodById("{Authentication_Id}", "{Name}")
2267+
.start(new Callback<Void, MyAccountException>() {
2268+
@Override
2269+
public void onSuccess(Void result) {
2270+
// Deletion successful
2271+
}
2272+
@Override
2273+
public void onFailure(@NonNull MyAccountException error) { }
2274+
});
2275+
```
2276+
</details>
2277+
2278+
22422279
## Credentials Manager
22432280

22442281
### Secure Credentials Manager

auth0/src/main/java/com/auth0/android/myaccount/MyAccountAPIClient.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,13 +364,13 @@ public class MyAccountAPIClient @VisibleForTesting(otherwise = VisibleForTesting
364364
* })
365365
* ```
366366
*
367-
* @param authenticationMethodId Id of the authentication method to be retrieved
367+
* @param authenticationMethodId Id of the authentication method to be updated
368368
* @param authenticationMethodName The friendly name of the authentication method
369369
* @param preferredAuthenticationMethod The preferred authentication method for the user. (for phone authenticators)
370370
*
371371
*/
372372
@JvmOverloads
373-
internal fun updateAuthenticationMethodById(
373+
public fun updateAuthenticationMethodById(
374374
authenticationMethodId: String,
375375
authenticationMethodName: String? = null,
376376
preferredAuthenticationMethod: PhoneAuthenticationMethodType? = null

0 commit comments

Comments
 (0)