Skip to content

Commit 9506d95

Browse files
authored
refactor : Deprecate the existing MFA APIs in AuthenticationAPIClient (#932)
1 parent 4671ebb commit 9506d95

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

EXAMPLES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,8 @@ authentication
423423

424424
> The default scope used is `openid profile email`. Regardless of the scopes set to the request, the `openid` scope is always enforced.
425425
426+
> **Note** : The MFA APIs in Authentication client has been deprecated. Use the new MFA Flexible Factors APIs
427+
426428
### MFA Flexible Factors Grant
427429

428430
> [!IMPORTANT]

auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.kt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ public class AuthenticationAPIClient @VisibleForTesting(otherwise = VisibleForTe
174174
return loginWithToken(requestParameters)
175175
}
176176

177+
177178
/**
178179
* Log in a user using the One Time Password code after they have received the 'mfa_required' error.
179180
* The MFA token tells the server the username or email, password, and realm values sent on the first request.
@@ -196,6 +197,10 @@ public class AuthenticationAPIClient @VisibleForTesting(otherwise = VisibleForTe
196197
* MFA application such as Google Authenticator or Guardian.
197198
* @return a request to configure and start that will yield [Credentials]
198199
*/
200+
@Deprecated(
201+
message = "loginWithOTP is deprecated and will be removed in the next major version of the SDK. Use the APIs in the [com.auth0.android.authentication.mfa.MfaApiClient] class instead.",
202+
level = DeprecationLevel.WARNING
203+
)
199204
public fun loginWithOTP(mfaToken: String, otp: String): AuthenticationRequest {
200205
val parameters = ParameterBuilder.newBuilder()
201206
.setGrantType(ParameterBuilder.GRANT_TYPE_MFA_OTP)
@@ -409,6 +414,10 @@ public class AuthenticationAPIClient @VisibleForTesting(otherwise = VisibleForTe
409414
* This is usually an OTP-like code delivered as part of the challenge message.
410415
* @return a request to configure and start that will yield [Credentials]
411416
*/
417+
@Deprecated(
418+
message = "loginWithOOB is deprecated and will be removed in the next major version of the SDK. Use the APIs in the [com.auth0.android.authentication.mfa.MfaApiClient] class instead.",
419+
level = DeprecationLevel.WARNING
420+
)
412421
public fun loginWithOOB(
413422
mfaToken: String,
414423
oobCode: String,
@@ -445,6 +454,10 @@ public class AuthenticationAPIClient @VisibleForTesting(otherwise = VisibleForTe
445454
* @return a request to configure and start that will yield [Credentials]. It might also include a [recoveryCode] field,
446455
* which your application must display to the end-user to be stored securely for future use.
447456
*/
457+
@Deprecated(
458+
message = "loginWithRecoveryCode is deprecated and will be removed in the next major version of the SDK. Use the APIs in the [com.auth0.android.authentication.mfa.MfaApiClient] class instead.",
459+
level = DeprecationLevel.WARNING
460+
)
448461
public fun loginWithRecoveryCode(
449462
mfaToken: String,
450463
recoveryCode: String
@@ -478,6 +491,10 @@ public class AuthenticationAPIClient @VisibleForTesting(otherwise = VisibleForTe
478491
* @param authenticatorId The ID of the authenticator to challenge.
479492
* @return a request to configure and start that will yield [Challenge]
480493
*/
494+
@Deprecated(
495+
message = "multifactorChallenge is deprecated and will be removed in the next major version of the SDK. Use the APIs in the [com.auth0.android.authentication.mfa.MfaApiClient] class instead.",
496+
level = DeprecationLevel.WARNING
497+
)
481498
public fun multifactorChallenge(
482499
mfaToken: String,
483500
challengeType: String? = null,

0 commit comments

Comments
 (0)