Skip to content

Commit 4689ff3

Browse files
committed
Enhancement EXAMPLE.md file
1 parent bb3adc3 commit 4689ff3

File tree

1 file changed

+88
-3
lines changed

1 file changed

+88
-3
lines changed

EXAMPLES.md

Lines changed: 88 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
- [Enroll a Push Notification Method](#enroll-a-push-notification-method)
3535
- [Enroll a Recovery Code](#enroll-a-recovery-code)
3636
- [Verify an Enrollment](#verify-an-enrollment)
37-
- [Update an Authentication Method](#update-an-authentication-method)
3837
- [Delete an Authentication Method](#delete-an-authentication-method)
3938
- [Credentials Manager](#credentials-manager)
4039
- [Secure Credentials Manager](#secure-credentials-manager)
@@ -972,6 +971,13 @@ client.enroll(passkeyCredential, challenge)
972971

973972
### Get Available Factors
974973
**Scopes required:** `read:me:factors`
974+
975+
Retrieves the list of multi-factor authentication (MFA) factors that are enabled for the tenant and available for the user to enroll.
976+
977+
**Prerequisites:**
978+
979+
Enable the desired MFA factors you want to be listed. Go to Auth0 Dashboard > Security > Multi-factor Auth.
980+
975981
```kotlin
976982
myAccountClient.getFactors()
977983
.start(object : Callback<List<Factor>, MyAccountException> {
@@ -994,10 +1000,19 @@ myAccountClient.getFactors()
9941000
@Override
9951001
public void onFailure(@NonNull MyAccountException error) { }
9961002
});
997-
```</details>
1003+
```
1004+
</details>
9981005

9991006
### Get All Enrolled Authentication Methods
10001007
**Scopes required:** `read:me:authentication_methods`
1008+
1009+
Retrieves a detailed list of all the authentication methods that the current user has already enrolled in.
1010+
1011+
1012+
**Prerequisites:**
1013+
1014+
The user must have one or more authentication methods already enrolled.
1015+
10011016
```kotlin
10021017
myAccountClient.getAuthenticationMethods()
10031018
.start(object : Callback<List<AuthenticationMethod>, MyAccountException> {
@@ -1025,6 +1040,13 @@ myAccountClient.getAuthenticationMethods()
10251040

10261041
### Get a Single Authentication Method by ID
10271042
**Scopes required:** `read:me:authentication_methods`
1043+
1044+
Retrieves a single authentication method by its unique ID.
1045+
1046+
**Prerequisites:**
1047+
1048+
The user must have the specific authentication method (identified by its ID) already enrolled.
1049+
10281050
```kotlin
10291051
myAccountClient.getAuthenticationMethodById("phone|dev_...")
10301052
.start(object : Callback<AuthenticationMethod, MyAccountException> {
@@ -1052,6 +1074,15 @@ myAccountClient.getAuthenticationMethodById("phone|dev_...")
10521074

10531075
### Enroll a Phone Method
10541076
**Scopes required:** `create:me:authentication_methods`
1077+
1078+
Enrolling a new phone authentication method is a two-step process. First, you request an enrollment challenge which sends an OTP to the user. Then, you must verify the enrollment with the received OTP.
1079+
1080+
**Prerequisites:**
1081+
1082+
Enable the MFA grant type for your application. Go to Auth0 Dashboard > Applications > Your App > Advanced Settings > Grant Types and select MFA.
1083+
1084+
Enable the Phone Message factor. Go to Auth0 Dashboard > Security > Multi-factor Auth > Phone Message.
1085+
10551086
```kotlin
10561087
myAccountClient.enrollPhone("+11234567890", PhoneAuthenticationMethodType.SMS)
10571088
.start(object : Callback<EnrollmentChallenge, MyAccountException> {
@@ -1075,10 +1106,20 @@ myAccountClient.enrollPhone("+11234567890", PhoneAuthenticationMethodType.SMS)
10751106
public void onFailure(@NonNull MyAccountException error) { }
10761107
});
10771108
```
1109+
10781110
</details>
10791111

10801112
### Enroll an Email Method
10811113
**Scopes required:** `create:me:authentication_methods`
1114+
1115+
Enrolling a new email authentication method is a two-step process. First, you request an enrollment challenge which sends an OTP to the user. Then, you must verify the enrollment with the received OTP.
1116+
1117+
**Prerequisites:**
1118+
1119+
Enable the MFA grant type for your application. Go to Auth0 Dashboard > Applications > Your App > Advanced Settings > Grant Types and select MFA.
1120+
1121+
Enable the Email factor. Go to Auth0 Dashboard > Security > Multi-factor Auth > Email.
1122+
10821123
```kotlin
10831124
myAccountClient.enrollEmail("[email protected]")
10841125
.start(object : Callback<EnrollmentChallenge, MyAccountException> {
@@ -1105,7 +1146,17 @@ myAccountClient.enrollEmail("[email protected]")
11051146
</details>
11061147

11071148
### Enroll a TOTP (Authenticator App) Method
1149+
11081150
**Scopes required:** `create:me:authentication_methods`
1151+
1152+
Enrolling a new TOTP (Authenticator App) authentication method is a two-step process. First, you request an enrollment challenge which provides a QR code or manual entry key. Then, you must verify the enrollment with an OTP from the authenticator app.
1153+
1154+
**Prerequisites:**
1155+
1156+
Enable the MFA grant type for your application. Go to Auth0 Dashboard > Applications > Your App > Advanced Settings > Grant Types and select MFA.
1157+
1158+
Enable the One-time Password factor. Go to Auth0 Dashboard > Security > Multi-factor Auth > One-time Password.
1159+
11091160
```kotlin
11101161
myAccountClient.enrollTotp()
11111162
.start(object : Callback<TotpEnrollmentChallenge, MyAccountException> {
@@ -1115,7 +1166,9 @@ myAccountClient.enrollTotp()
11151166
// Then use result.id and result.authSession to verify.
11161167
}
11171168
override fun onFailure(error: MyAccountException) { }
1118-
})```
1169+
})
1170+
```
1171+
11191172
<details>
11201173
<summary>Using Java</summary>
11211174

@@ -1136,6 +1189,15 @@ myAccountClient.enrollTotp()
11361189

11371190
### Enroll a Push Notification Method
11381191
**Scopes required:** `create:me:authentication_methods`
1192+
1193+
Enrolling a new Push Notification authentication method is a two-step process. First, you request an enrollment challenge which provides a QR code. Then, after the user scans the QR code and approves, you must confirm the enrollment.
1194+
1195+
**Prerequisites:**
1196+
1197+
Enable the MFA grant type for your application. Go to Auth0 Dashboard > Applications > Your App > Advanced Settings > Grant Types and select MFA.
1198+
1199+
Enable the Push Notification factor. Go to Auth0 Dashboard > Security > Multi-factor Auth > Push Notification using Auth0 Guardian.
1200+
11391201
```kotlin
11401202
myAccountClient.enrollPushNotification()
11411203
.start(object : Callback<TotpEnrollmentChallenge, MyAccountException> {
@@ -1167,6 +1229,15 @@ myAccountClient.enrollPushNotification()
11671229

11681230
### Enroll a Recovery Code
11691231
**Scopes required:** `create:me:authentication_methods`
1232+
1233+
Enrolls a new recovery code for the user. This is a single-step process that immediately returns the recovery code. The user must save this code securely as it will not be shown again.
1234+
1235+
**Prerequisites:**
1236+
1237+
Enable the MFA grant type for your application. Go to Auth0 Dashboard > Applications > Your App > Advanced Settings > Grant Types and select MFA.
1238+
1239+
Enable the Recovery Code factor. Go to Auth0 Dashboard > Security > Multi-factor Auth > Recovery Code.
1240+
11701241
```kotlin
11711242
myAccountClient.enrollRecoveryCode()
11721243
.start(object : Callback<RecoveryCodeEnrollmentChallenge, MyAccountException> {
@@ -1199,6 +1270,13 @@ myAccountClient.enrollRecoveryCode()
11991270

12001271
### Verify an Enrollment
12011272
**Scopes required:** `create:me:authentication_methods`
1273+
1274+
Confirms the enrollment of an authentication method after the user has completed the initial challenge (e.g., entered an OTP, scanned a QR code).
1275+
1276+
Prerequisites:
1277+
1278+
An enrollment must have been successfully started to obtain the challenge_id and auth_session.
1279+
12021280
```kotlin
12031281
// For OTP-based factors (TOTP, Email, Phone)
12041282
myAccountClient.verifyOtp("challenge_id_from_enroll", "123456", "auth_session_from_enroll")
@@ -1248,6 +1326,13 @@ myAccountClient.verify("challenge_id_from_enroll", "auth_session_from_enroll")
12481326

12491327
### Delete an Authentication Method
12501328
**Scopes required:** `delete:me:authentication_methods`
1329+
1330+
Deletes an existing authentication method belonging to the current user.
1331+
1332+
**Prerequisites:**
1333+
1334+
The user must have the specific authentication method (identified by its ID) already enrolled.
1335+
12511336
```kotlin
12521337
myAccountClient.deleteAuthenticationMethod("phone|dev_...")
12531338
.start(object : Callback<Unit, MyAccountException> {

0 commit comments

Comments
 (0)