You are here

public static function MoAuthUtilities::get_2fa_methods_for_inline_registration in Google Authenticator / 2 Factor Authentication - 2FA 8.2

3 calls to MoAuthUtilities::get_2fa_methods_for_inline_registration()
miniorange_2fa_inline_registration::handle_page_two_submit in src/Form/miniorange_2fa_inline_registration.php
miniorange_2fa_inline_registration::mo_auth_inline_registration_page_three in src/Form/miniorange_2fa_inline_registration.php
MoAuthLoginSettings::getSelected2faMethods in src/Form/MoAuthLoginSettings.php
Process allowed 2FA methods in inline registration flow

File

src/MoAuthUtilities.php, line 136
This file is part of miniOrange 2FA module.

Class

MoAuthUtilities

Namespace

Drupal\miniorange_2fa

Code

public static function get_2fa_methods_for_inline_registration($methods_selected) {
  if ($methods_selected === TRUE && \Drupal::config('miniorange_2fa.settings')
    ->get('mo_auth_enable_allowed_2fa_methods')) {
    $selected_2fa_methods = json_decode(\Drupal::config('miniorange_2fa.settings')
      ->get('mo_auth_selected_2fa_methods'), TRUE);
    if (!empty($selected_2fa_methods)) {
      return $selected_2fa_methods;
    }
  }
  $options = array(
    AuthenticationType::$EMAIL_VERIFICATION['code'] => AuthenticationType::$EMAIL_VERIFICATION['name'],
    AuthenticationType::$GOOGLE_AUTHENTICATOR['code'] => AuthenticationType::$GOOGLE_AUTHENTICATOR['name'],
    AuthenticationType::$MICROSOFT_AUTHENTICATOR['code'] => AuthenticationType::$MICROSOFT_AUTHENTICATOR['name'],
    AuthenticationType::$DUO_AUTHENTICATOR['code'] => AuthenticationType::$DUO_AUTHENTICATOR['name'],
    AuthenticationType::$AUTHY_AUTHENTICATOR['code'] => AuthenticationType::$AUTHY_AUTHENTICATOR['name'],
    AuthenticationType::$LASTPASS_AUTHENTICATOR['code'] => AuthenticationType::$LASTPASS_AUTHENTICATOR['name'],
    AuthenticationType::$SMS['code'] => AuthenticationType::$SMS['name'],
    AuthenticationType::$EMAIL['code'] => AuthenticationType::$EMAIL['name'],
    AuthenticationType::$SMS_AND_EMAIL['code'] => AuthenticationType::$SMS_AND_EMAIL['name'],
    AuthenticationType::$OTP_OVER_PHONE['code'] => AuthenticationType::$OTP_OVER_PHONE['name'],
    AuthenticationType::$KBA['code'] => AuthenticationType::$KBA['name'],
    AuthenticationType::$QR_CODE['code'] => AuthenticationType::$QR_CODE['name'],
    AuthenticationType::$PUSH_NOTIFICATIONS['code'] => AuthenticationType::$PUSH_NOTIFICATIONS['name'],
    AuthenticationType::$SOFT_TOKEN['code'] => AuthenticationType::$SOFT_TOKEN['name'],
    AuthenticationType::$HARDWARE_TOKEN['code'] => AuthenticationType::$HARDWARE_TOKEN['name'],
  );
  return $options;
}