startTwoFactorLogin method

Start a Two-Factor login request by generating a two-factor identifier. This code can then be sent to the Two Factor Send API (/api/two-factor/send)in order to send a one-time use code to a user. You can also use one-time use code returned to send the code out-of-band. The Two-Factor login is completed by making a request to the Two-Factor Login API (/api/two-factor/login). with the two-factor identifier and the one-time use code.

This API is intended to allow you to begin a Two-Factor login outside a normal login that originated from the Login API (/api/login).

@param {TwoFactorStartRequest} request The Two-Factor start request that contains all the information used to begin the Two-Factor login request. @returns {Promise<ClientResponse

Implementation

Future<ClientResponse<TwoFactorStartResponse, Errors>> startTwoFactorLogin(
    TwoFactorStartRequest request) {
  return _start<TwoFactorStartResponse, Errors>()
      .withUri('/api/two-factor/start')
      .withJSONBody(request)
      .withMethod('POST')
      .withResponseHandler(defaultResponseHandlerBuilder(
          (d) => TwoFactorStartResponse.fromJson(d)))
      .go();
}