最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

java - How to determine what exact authentication type was used? - Stack Overflow

programmeradmin1浏览0评论

I need to identify which of the following was exactly used to authenticate user:

  • Passcode
  • Password
  • Pattern
  • Biometric fingerprint
  • Biometric facial recognition
  • Biometric iris recognition
  • Biometric voice recognition
  • Behavioral biometric

Right now, I am just able to differentiate between the DEVICE_CREDENTIAL and BIOMETRIC_STRONG based on below

int BIOMETRIC_STRONG
Any biometric (e.g. fingerprint, iris, or face) on the device that meets or exceeds the requirements for Class 3 (formerly Strong), as defined by the Android CDD.

int BIOMETRIC_WEAK
Any biometric (e.g. fingerprint, iris, or face) on the device that meets or exceeds the requirements for Class 2 (formerly Weak), as defined by the Android CDD.

int DEVICE_CREDENTIAL
The non-biometric credential used to secure the device (i.e., PIN, pattern, or password).

UseCase:: I am building an application in which after authentication I need to send what verification method was used to verify the user to the backend. Using android BiometricManager getAutheticationType I just get below info but I need further classification asper above shared list.

String authType = switch (result.getAuthenticationType()) {
                    case BiometricPrompt.AUTHENTICATION_RESULT_TYPE_BIOMETRIC -> "13";
                    case BiometricPrompt.AUTHENTICATION_RESULT_TYPE_DEVICE_CREDENTIAL -> "10";
                    case BiometricPrompt.AUTHENTICATION_RESULT_TYPE_UNKNOWN -> "10";
                    default -> "10";
                };

I need to identify which of the following was exactly used to authenticate user:

  • Passcode
  • Password
  • Pattern
  • Biometric fingerprint
  • Biometric facial recognition
  • Biometric iris recognition
  • Biometric voice recognition
  • Behavioral biometric

Right now, I am just able to differentiate between the DEVICE_CREDENTIAL and BIOMETRIC_STRONG based on below

int BIOMETRIC_STRONG
Any biometric (e.g. fingerprint, iris, or face) on the device that meets or exceeds the requirements for Class 3 (formerly Strong), as defined by the Android CDD.

int BIOMETRIC_WEAK
Any biometric (e.g. fingerprint, iris, or face) on the device that meets or exceeds the requirements for Class 2 (formerly Weak), as defined by the Android CDD.

int DEVICE_CREDENTIAL
The non-biometric credential used to secure the device (i.e., PIN, pattern, or password).

UseCase:: I am building an application in which after authentication I need to send what verification method was used to verify the user to the backend. Using android BiometricManager getAutheticationType I just get below info but I need further classification asper above shared list.

String authType = switch (result.getAuthenticationType()) {
                    case BiometricPrompt.AUTHENTICATION_RESULT_TYPE_BIOMETRIC -> "13";
                    case BiometricPrompt.AUTHENTICATION_RESULT_TYPE_DEVICE_CREDENTIAL -> "10";
                    case BiometricPrompt.AUTHENTICATION_RESULT_TYPE_UNKNOWN -> "10";
                    default -> "10";
                };
Share Improve this question edited Nov 20, 2024 at 9:14 Go For Pro asked Nov 19, 2024 at 11:54 Go For ProGo For Pro 871 silver badge10 bronze badges 2
  • 1 Used for what? What is the use case? Provide more context to the question. – aled Commented Nov 19, 2024 at 12:25
  • updated usecase – Go For Pro Commented Nov 20, 2024 at 9:15
Add a comment  | 

1 Answer 1

Reset to default 0

Sorry, but what you want is not supported by Android.

发布评论

评论列表(0)

  1. 暂无评论