Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ internal class ErrorTypes {
*/
const val VERIFICATION_CONTACT_BLOCKED = "verification_contact_blocked"

/*
* The AUTH_METHOD_BLOCKED value indicates that the server blocked the strong authentication method.
* Try contacting customer support to seek assistance.
*/
const val AUTH_METHOD_BLOCKED = "auth_method_blocked"

/*
* The INVALID_STATE value indicates a misconfigured or expired state, or an internal error
* in state transitions. If this occurs, the flow should be restarted.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class MFARequestChallengeError(
val subError: String? = null,
override var exception: Exception? = null
): MFARequiredResult, BrowserRequiredError, Error(errorType = errorType, error = error, errorMessage= errorMessage, correlationId = correlationId, errorCodes = errorCodes, exception = exception)
{
fun isAuthMethodBlocked(): Boolean = this.errorType == ErrorTypes.AUTH_METHOD_BLOCKED
}

/**
* MFA submit challenge error. The user should use the utility methods of this class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class AwaitingMFAState(
}

/**
* Requests a challenge to be sent to the user's default authentication method; Kotlin coroutines variant.
* Requests a challenge to be sent to the authentication method; Kotlin coroutines variant.
*
* <strong><u>Warning: this API is experimental. It may be changed in the future without notice. Do not use in production applications.</u></strong>
* @return The result of the request challenge action.
Expand Down Expand Up @@ -165,6 +165,14 @@ class AwaitingMFAState(
correlationId = result.correlationId
)
}
is MFACommandResult.BlockedAuthMethod -> {
MFARequestChallengeError(
errorType = ErrorTypes.AUTH_METHOD_BLOCKED,
error = result.error,
errorMessage = result.errorDescription,
correlationId = result.correlationId
)
}
}
} catch (e: Exception) {
MFARequestChallengeError(
Expand Down Expand Up @@ -245,7 +253,7 @@ class MFARequiredState(
}

/**
* Requests a challenge to be sent to the user's default authentication method; Kotlin coroutines variant.
* Requests a challenge to be sent to authentication method; Kotlin coroutines variant.
*
* <strong><u>Warning: this API is experimental. It may be changed in the future without notice. Do not use in production applications.</u></strong>
* @param authMethod [com.microsoft.identity.nativeauth.AuthMethod] the authentication method used for the challenge operation.
Expand Down Expand Up @@ -318,6 +326,14 @@ class MFARequiredState(
correlationId = result.correlationId
)
}
is MFACommandResult.BlockedAuthMethod -> {
MFARequestChallengeError(
errorType = ErrorTypes.AUTH_METHOD_BLOCKED,
error = result.error,
errorMessage = result.errorDescription,
correlationId = result.correlationId
)
}
}
} catch (e: Exception) {
MFARequestChallengeError(
Expand Down