class AuthenticationType in Google Authenticator / 2 Factor Authentication - 2FA 8
Same name and namespace in other branches
- 8.2 src/AuthenticationType.php \Drupal\miniorange_2fa\AuthenticationType
@file This class represents authentication type.
Hierarchy
- class \Drupal\miniorange_2fa\AuthenticationType
Expanded class hierarchy of AuthenticationType
19 files declare their use of AuthenticationType
- authenticate_user.php in src/
Form/ authenticate_user.php - This is used to authenticate user during login.
- configure_google_authenticator.php in src/
Form/ configure_google_authenticator.php - configure_kba.php in src/
Form/ configure_kba.php - configure_otp_over_email.php in src/
Form/ configure_otp_over_email.php - configure_otp_over_phone.php in src/
Form/ configure_otp_over_phone.php
File
- src/
AuthenticationType.php, line 12 - Contains Authentication type class.
Namespace
Drupal\miniorange_2faView source
class AuthenticationType {
public static $SMS_AND_EMAIL = array(
'id' => 'otp-over-sms-and-email',
'name' => 'OTP Over SMS and EMAIL',
'code' => 'SMS AND EMAIL',
'description' => 'You will receive a one time passcode on your mobile phone and email. You have to enter the otp on your screen to login. Supported in Desktops, Laptops, Smartphones, Feature Phones.',
'supported-for' => array(
'Laptops Phones',
),
'challenge' => TRUE,
'oob' => FALSE,
);
public static $SMS = array(
'id' => 'otp-over-sms',
'name' => 'OTP Over SMS',
'code' => 'SMS',
'description' => 'You will receive a one time passcode via SMS on your phone. You have to enter the otp on your screen to login. Supported in Smartphones, Feature Phones.',
'supported-for' => array(
'Feature Phones',
),
'challenge' => TRUE,
'oob' => FALSE,
);
public static $OTP_OVER_EMAIL = array(
'id' => 'otp-over-email',
'name' => 'OTP Over Email',
'code' => 'EMAIL',
'description' => 'You will receive a one time passcode via an email. You have to enter the otp on your screen to login. Supported in Smartphones, Feature Phones.',
'supported-for' => array(
'Laptops',
),
'challenge' => TRUE,
'oob' => FALSE,
);
public static $OTP_OVER_PHONE = array(
'id' => 'otp-over-phone',
'name' => 'OTP Over Phone Call',
'code' => 'PHONE VERIFICATION',
'description' => 'You will receive a one time passcode via phone call. You have to enter the otp on your screen to login. Supported in Smartphones, Feature Phones.',
'supported-for' => array(
'Landline',
),
'challenge' => TRUE,
'oob' => FALSE,
);
public static $EMAIL = array(
'id' => 'email',
'name' => 'OTP Over Email',
'code' => 'EMAIL',
'description' => 'You will receive a one time passcode via Email. You have to enter the otp on your screen to login. Supported in Smartphones, Feature Phones.',
'supported-for' => array(
'Laptops',
),
'challenge' => TRUE,
'oob' => FALSE,
);
// Out of band Email
public static $EMAIL_VERIFICATION = array(
'id' => 'email-verification',
'name' => 'Email Verification',
'code' => 'OUT OF BAND EMAIL',
'description' => 'You will receive an email with link. You have to click the <em>ACCEPT</em> or <em>DENY</em> link to verify your email. Supported in Desktops, Laptops, Smartphones.',
'supported-for' => array(
'Laptops',
),
'challenge' => TRUE,
'oob' => TRUE,
);
public static $GOOGLE_AUTHENTICATOR = array(
'id' => 'google-authenticator',
'name' => 'Google Authenticator',
'code' => 'GOOGLE AUTHENTICATOR',
'description' => 'You have to enter code generated by <em>Google Authenticator App</em> to login. Supported in Smartphones only.',
'supported-for' => array(
'Smartphones',
),
'challenge' => FALSE,
'oob' => FALSE,
);
public static $QR_CODE = array(
'id' => 'qrcode-authentication',
'name' => 'QR Code Authentication',
'code' => 'MOBILE AUTHENTICATION',
'description' => 'You have to scan the QR Code from your phone using <em>miniOrange Authenticator App</em> to login. Supported in Smartphones only.',
'supported-for' => array(
'Smartphones',
),
'challenge' => TRUE,
'oob' => TRUE,
);
public static $KBA = array(
'id' => 'kba-authentication',
'name' => 'Security Questions (KBA)',
'code' => 'KBA',
'description' => 'You have to answers some knowledge based security questions which are only known to you to authenticate yourself. Supported in Desktops, Laptops, Smartphones.',
'supported-for' => array(
'Laptops',
),
'challenge' => TRUE,
'oob' => FALSE,
);
public static $SOFT_TOKEN = array(
'id' => 'soft-token',
'name' => 'Soft Token',
'code' => 'SOFT TOKEN',
'description' => 'You have to enter code generated by <em>miniOrange Authenticator App</em> to login. Supported in Smartphones only.',
'supported-for' => array(
'Smartphones',
),
'challenge' => FALSE,
'oob' => FALSE,
);
public static $PUSH_NOTIFICATIONS = array(
'id' => 'push-notifications',
'name' => 'Push Notifications',
'code' => 'PUSH NOTIFICATIONS',
'description' => 'You will receive a push notification on your phone. You have to <em>ACCEPT</em> or <em>DENY</em> it to login. Supported in Smartphones only.',
'supported-for' => array(
'Smartphones',
),
'challenge' => TRUE,
'oob' => TRUE,
);
public static function getAuthType($code) {
$arr = array(
"SMS_AND_EMAIL" => AuthenticationType::$SMS_AND_EMAIL,
"OTP_OVER_EMAIL" => AuthenticationType::$OTP_OVER_EMAIL,
"EMAIL" => AuthenticationType::$EMAIL,
"SMS" => AuthenticationType::$SMS,
"EMAIL_VERIFICATION" => AuthenticationType::$EMAIL_VERIFICATION,
"GOOGLE_AUTHENTICATOR" => AuthenticationType::$GOOGLE_AUTHENTICATOR,
"QR_CODE" => AuthenticationType::$QR_CODE,
"KBA" => AuthenticationType::$KBA,
"SOFT_TOKEN" => AuthenticationType::$SOFT_TOKEN,
"PUSH_NOTIFICATIONS" => AuthenticationType::$PUSH_NOTIFICATIONS,
"PHONE_VERIFICATION" => AuthenticationType::$OTP_OVER_PHONE,
);
foreach ($arr as $authType) {
if (strcasecmp($authType['code'], $code) == 0) {
return $authType;
}
}
return NULL;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AuthenticationType:: |
public static | property | ||
AuthenticationType:: |
public static | property | ||
AuthenticationType:: |
public static | property | ||
AuthenticationType:: |
public static | property | ||
AuthenticationType:: |
public static | property | ||
AuthenticationType:: |
public static | property | ||
AuthenticationType:: |
public static | property | ||
AuthenticationType:: |
public static | property | ||
AuthenticationType:: |
public static | property | ||
AuthenticationType:: |
public static | property | ||
AuthenticationType:: |
public static | property | ||
AuthenticationType:: |
public static | function |