mfaStart(WithStepUp)
AppDelegate.reachfive().mfaStart(
stepUp: StartStepUp.<AuthTokenFlow | LoginFlow> (1)
)
| 1 | Depending on your requirements, this will either be AuthTokenFlow or LoginFlow. |
About this command
Starts the step-up process for the MFA flow. This method handles two cases:
-
AuthTokenFlow: for the traditional step-up flow which requires an auth token. -
LoginFlow: for initiating the step-up flow using loginWithPassword.
| The presence of an active session cookie is required. It is automatically retrieved by the function. |
Examples
import Reach5
let scope = ["openid", "email", "profile", "phone", "full_write", "offline_access"]
do {
let response = try await AppDelegate.reachfive().mfaStart(
stepUp: .AuthTokenFlow(
authType: .email,
authToken: profileAuthToken,
scope: scope
)
)
// Do something
} catch {
// Return a ReachFive error
}
import Reach5
let scope = ["openid", "email", "profile", "phone", "full_write", "offline_access"]
do {
let response = try await AppDelegate.reachfive().mfaStart(
stepUp: .LoginFlow(
authType: .email,
stepUpToken: "stepUpToken123",
redirectUri: URL(string: "https://example.com/callback")!,
origin: "ios-app"
)
)
// Do something
} catch {
// Return a ReachFive error
}
Parameters
Contains the necessary fields to begin the step up process.
|
Response
-
Type: ContinueStepUp
-
Error: ReachFiveError
ReachFiveError
Based on the problem, the ReachFiveError will be:
-
AuthCanceled: Nothing happened, and nothing is expected of you — ignoring it is a valid way to handle it.
This can happen for any of the following reasons:-
The user canceled the request.
-
No passkey was saved for your app.
-
A web login was dropped because another one was already in progress. See webviewLogin.
-
The app is not associated with the host of an
WebProvider.universalLinkcallback. See guides/apple-app-site-association.adoc#webcredentials.
-
-
RequestError(apiError: ApiError)for a Bad Request (status 400) error. -
AuthFailure(reason: String, apiError: ApiError?)mainly for Unauthorized (status 401) error. -
TechnicalError(reason: String, apiError: ApiError?)if it’s an Internal Server Error (status 500) or other internal errors.
ApiError
error |
The main error message. |
||||||
errorId |
The identifier of the error. |
||||||
errorUserMsg |
The user-friendly error message.
|
||||||
errorMessageKey |
The error message key. |
||||||
errorDescription |
The technical error message. |
||||||
errorDetails FieldError[] |
|