Uygulamanızdaki hassas bilgileri veya premium içeriği korumanın yöntemlerinden biri, yüz tanıma veya parmak izi tanıma gibi özellikleri kullanarak biyometrik kimlik doğrulama istemektir. Bu kılavuzda, uygulamanızda biyometrik giriş akışlarını nasıl destekleyeceğiniz açıklanmaktadır.
Genel kural olarak, bir cihazda ilk kez oturum açmak için Kimlik Bilgisi Yöneticisi'ni kullanmanız gerekir. Sonraki yeniden yetkilendirme işlemleri Biyometrik İstemi veya Kimlik Bilgisi Yöneticisi ile yapılabilir. Biyometrik istem kullanmanın avantajı daha fazla özelleştirme seçeneği sunmasıdır. Kimlik bilgisi yöneticisi ise her iki akışta da tek bir uygulama sunar.
Uygulamanızın desteklediği kimlik doğrulama türlerini beyan edin
Uygulamanızın desteklediği kimlik doğrulama türlerini tanımlamak için BiometricManager.Authenticators
arayüzünü kullanın. Sistem, aşağıdaki kimlik doğrulama türlerini bildirmenize olanak tanır:
BIOMETRIC_STRONG
- Android uyumluluk tanımı sayfasında tanımlandığı şekilde 3. sınıf biyometri kullanılarak kimlik doğrulama.
BIOMETRIC_WEAK
- Android uyumluluk tanımı sayfasında tanımlandığı şekilde 2.Sınıf biyometri kullanılarak kimlik doğrulama
DEVICE_CREDENTIAL
- Ekran kilidi kimlik bilgisi (kullanıcının PIN'i, deseni veya şifresi) kullanılarak kimlik doğrulama.
Kullanıcının, kimlik doğrulayıcıyı kullanmaya başlamak için PIN, desen veya şifre oluşturması gerekir. Kullanıcının biyometrik kaydı yoksa kayıt akışı, kullanıcıdan biyometrik kayıt oluşturmasını ister.
Uygulamanızın kabul ettiği biyometrik kimlik doğrulama türlerini tanımlamak için setAllowedAuthenticators()
yöntemine bir kimlik doğrulama türü veya türlerin bit düzeyinde bir kombinasyonunu iletin. Aşağıdaki kod snippet'inde, 3. Sınıf biyometri veya ekran kilidi kimlik bilgisi kullanılarak kimlik doğrulamanın nasıl destekleneceği gösterilmektedir.
Kotlin
// Lets the user authenticate using either a Class 3 biometric or // their lock screen credential (PIN, pattern, or password). promptInfo = BiometricPrompt.PromptInfo.Builder() .setTitle("Biometric login for my app") .setSubtitle("Log in using your biometric credential") .setAllowedAuthenticators(BIOMETRIC_STRONG or DEVICE_CREDENTIAL) .build()
Java
// Lets user authenticate using either a Class 3 biometric or // their lock screen credential (PIN, pattern, or password). promptInfo = new BiometricPrompt.PromptInfo.Builder() .setTitle("Biometric login for my app") .setSubtitle("Log in using your biometric credential") .setAllowedAuthenticators(BIOMETRIC_STRONG | DEVICE_CREDENTIAL) .build();
Android 10 (API düzeyi 29) ve önceki sürümlerde aşağıdaki kimlik doğrulayıcı türü kombinasyonları desteklenmez: DEVICE_CREDENTIAL
ve BIOMETRIC_STRONG | DEVICE_CREDENTIAL
. Android 10 ve önceki sürümlerde PIN, desen veya şifre olup olmadığını kontrol etmek için KeyguardManager.isDeviceSecure()
yöntemini kullanın.
Biyometrik kimlik doğrulamanın kullanılabildiğini kontrol etme
Uygulamanızın desteklediği kimlik doğrulama öğelerine karar verdikten sonra bu öğelerin kullanılabilir olup olmadığını kontrol edin. Bunu yapmak için setAllowedAuthenticators()
yöntemiyle bildirdiğiniz türlerin aynı bit düzeyinde kombinasyonunu canAuthenticate()
yöntemine iletin.
Gerekirse ACTION_BIOMETRIC_ENROLL
amaç işlemini çağırın. Amaç ekstrasında, uygulamanızın kabul ettiği kimlik doğrulayıcılar grubunu sağlayın. Bu amaç, kullanıcıdan uygulamanızın kabul ettiği bir kimlik doğrulayıcı için kimlik bilgilerini kaydetmesini ister.
Kotlin
val biometricManager = BiometricManager.from(this) when (biometricManager.canAuthenticate(BIOMETRIC_STRONG or DEVICE_CREDENTIAL)) { BiometricManager.BIOMETRIC_SUCCESS -> Log.d("MY_APP_TAG", "App can authenticate using biometrics.") BiometricManager.BIOMETRIC_ERROR_NO_HARDWARE -> Log.e("MY_APP_TAG", "No biometric features available on this device.") BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE -> Log.e("MY_APP_TAG", "Biometric features are currently unavailable.") BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED -> { // Prompts the user to create credentials that your app accepts. val enrollIntent = Intent(Settings.ACTION_BIOMETRIC_ENROLL).apply { putExtra(Settings.EXTRA_BIOMETRIC_AUTHENTICATORS_ALLOWED, BIOMETRIC_STRONG or DEVICE_CREDENTIAL) } startActivityForResult(enrollIntent, REQUEST_CODE) } }
Java
BiometricManager biometricManager = BiometricManager.from(this); switch (biometricManager.canAuthenticate(BIOMETRIC_STRONG | DEVICE_CREDENTIAL)) { case BiometricManager.BIOMETRIC_SUCCESS: Log.d("MY_APP_TAG", "App can authenticate using biometrics."); break; case BiometricManager.BIOMETRIC_ERROR_NO_HARDWARE: Log.e("MY_APP_TAG", "No biometric features available on this device."); break; case BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE: Log.e("MY_APP_TAG", "Biometric features are currently unavailable."); break; case BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED: // Prompts the user to create credentials that your app accepts. final Intent enrollIntent = new Intent(Settings.ACTION_BIOMETRIC_ENROLL); enrollIntent.putExtra(Settings.EXTRA_BIOMETRIC_AUTHENTICATORS_ALLOWED, BIOMETRIC_STRONG | DEVICE_CREDENTIAL); startActivityForResult(enrollIntent, REQUEST_CODE); break; }
Kullanıcının kimliğinin nasıl doğrulandığını belirleme
Kullanıcı kimliğini doğruladıktan sonra getAuthenticationType()
işlevini çağırarak kullanıcının cihaz kimlik bilgisi veya biyometrik kimlik bilgisi kullanarak kimliğini doğrulayıp doğrulamadığını kontrol edebilirsiniz.
Giriş istemini görüntüleme
Kullanıcıdan biyometrik kimlik bilgilerini kullanarak kimlik doğrulaması yapmasını isteyen bir sistem istemi göstermek için Biometric kitaplığını kullanın. Bu sistem tarafından sağlanan iletişim kutusu, kullanan uygulamalarda tutarlıdır ve daha güvenilir bir kullanıcı deneyimi sunar. Şekil 1'de örnek bir iletişim kutusu gösterilmektedir.
Biyometrik kitaplığını kullanarak uygulamanıza biyometrik kimlik doğrulama eklemek için aşağıdaki adımları tamamlayın:
Uygulama modülünüzün
build.gradle
dosyasındaandroidx.biometric
kitaplığına bağımlılık ekleyin.Biyometrik giriş iletişim kutusunu barındıran etkinlikte veya parçada, aşağıdaki kod snippet'inde gösterilen mantığı kullanarak iletişim kutusunu gösterin:
Kotlin
private lateinit var executor: Executor private lateinit var biometricPrompt: BiometricPrompt private lateinit var promptInfo: BiometricPrompt.PromptInfo override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_login) executor = ContextCompat.getMainExecutor(this) biometricPrompt = BiometricPrompt(this, executor, object : BiometricPrompt.AuthenticationCallback() { override fun onAuthenticationError(errorCode: Int, errString: CharSequence) { super.onAuthenticationError(errorCode, errString) Toast.makeText(applicationContext, "Authentication error: $errString", Toast.LENGTH_SHORT) .show() } override fun onAuthenticationSucceeded( result: BiometricPrompt.AuthenticationResult) { super.onAuthenticationSucceeded(result) Toast.makeText(applicationContext, "Authentication succeeded!", Toast.LENGTH_SHORT) .show() } override fun onAuthenticationFailed() { super.onAuthenticationFailed() Toast.makeText(applicationContext, "Authentication failed", Toast.LENGTH_SHORT) .show() } }) promptInfo = BiometricPrompt.PromptInfo.Builder() .setTitle("Biometric login for my app") .setSubtitle("Log in using your biometric credential") .setNegativeButtonText("Use account password") .build() // Prompt appears when user clicks "Log in". // Consider integrating with the keystore to unlock cryptographic operations, // if needed by your app. val biometricLoginButton = findViewById<Button>(R.id.biometric_login) biometricLoginButton.setOnClickListener { biometricPrompt.authenticate(promptInfo) } }
Java
private Executor executor; private BiometricPrompt biometricPrompt; private BiometricPrompt.PromptInfo promptInfo; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); executor = ContextCompat.getMainExecutor(this); biometricPrompt = new BiometricPrompt(MainActivity.this, executor, new BiometricPrompt.AuthenticationCallback() { @Override public void onAuthenticationError(int errorCode, @NonNull CharSequence errString) { super.onAuthenticationError(errorCode, errString); Toast.makeText(getApplicationContext(), "Authentication error: " + errString, Toast.LENGTH_SHORT) .show(); } @Override public void onAuthenticationSucceeded( @NonNull BiometricPrompt.AuthenticationResult result) { super.onAuthenticationSucceeded(result); Toast.makeText(getApplicationContext(), "Authentication succeeded!", Toast.LENGTH_SHORT).show(); } @Override public void onAuthenticationFailed() { super.onAuthenticationFailed(); Toast.makeText(getApplicationContext(), "Authentication failed", Toast.LENGTH_SHORT) .show(); } }); promptInfo = new BiometricPrompt.PromptInfo.Builder() .setTitle("Biometric login for my app") .setSubtitle("Log in using your biometric credential") .setNegativeButtonText("Use account password") .build(); // Prompt appears when user clicks "Log in". // Consider integrating with the keystore to unlock cryptographic operations, // if needed by your app. Button biometricLoginButton = findViewById(R.id.biometric_login); biometricLoginButton.setOnClickListener(view -> { biometricPrompt.authenticate(promptInfo); }); }
Kimlik doğrulamaya dayalı bir kriptografik çözüm kullanma
Uygulamanızdaki hassas bilgileri daha iyi korumak için CryptoObject
örneğini kullanarak biyometrik kimlik doğrulama iş akışınıza kriptografi ekleyebilirsiniz.
Çerçeve, aşağıdaki kriptografik nesneleri destekler:
Signature
, Cipher
ve
Mac
.
Kullanıcı, biyometrik istemi kullanarak kimliğini başarıyla doğruladıktan sonra uygulamanız şifreleme işlemi gerçekleştirebilir. Örneğin, Cipher
nesnesiyle kimlik doğrulaması yaparsanız uygulamanız daha sonra SecretKey
nesnesiyle şifreleme ve şifre çözme işlemlerini gerçekleştirebilir.
Aşağıdaki bölümlerde, verileri şifrelemek için Cipher
nesnesi ve SecretKey
nesnesi kullanma örnekleri verilmiştir. Her örnekte aşağıdaki yöntemler kullanılır:
Kotlin
private fun generateSecretKey(keyGenParameterSpec: KeyGenParameterSpec) { val keyGenerator = KeyGenerator.getInstance( KeyProperties.KEY_ALGORITHM_AES, "AndroidKeyStore") keyGenerator.init(keyGenParameterSpec) keyGenerator.generateKey() } private fun getSecretKey(): SecretKey { val keyStore = KeyStore.getInstance("AndroidKeyStore") // Before the keystore can be accessed, it must be loaded. keyStore.load(null) return keyStore.getKey(KEY_NAME, null) as SecretKey } private fun getCipher(): Cipher { return Cipher.getInstance(KeyProperties.KEY_ALGORITHM_AES + "/" + KeyProperties.BLOCK_MODE_CBC + "/" + KeyProperties.ENCRYPTION_PADDING_PKCS7) }
Java
private void generateSecretKey(KeyGenParameterSpec keyGenParameterSpec) { KeyGenerator keyGenerator = KeyGenerator.getInstance( KeyProperties.KEY_ALGORITHM_AES, "AndroidKeyStore"); keyGenerator.init(keyGenParameterSpec); keyGenerator.generateKey(); } private SecretKey getSecretKey() { KeyStore keyStore = KeyStore.getInstance("AndroidKeyStore"); // Before the keystore can be accessed, it must be loaded. keyStore.load(null); return ((SecretKey)keyStore.getKey(KEY_NAME, null)); } private Cipher getCipher() { return Cipher.getInstance(KeyProperties.KEY_ALGORITHM_AES + "/" + KeyProperties.BLOCK_MODE_CBC + "/" + KeyProperties.ENCRYPTION_PADDING_PKCS7); }
Yalnızca biyometrik kimlik bilgileriyle kimlik doğrulama
Uygulamanızın kilidini açmak için biyometrik kimlik bilgilerinin gerektiği bir gizli anahtar kullanıyorsa uygulamanız anahtara erişmeden her seferinde kullanıcının biyometrik kimlik bilgilerini doğrulaması gerekir.
Hassas bilgileri yalnızca kullanıcı biyometrik kimlik bilgilerini kullanarak kimliğini doğruladıktan sonra şifrelemek için aşağıdaki adımları tamamlayın:
Aşağıdaki yapılandırmayı
KeyGenParameterSpec
kullanan bir anahtar oluşturun:Kotlin
generateSecretKey(KeyGenParameterSpec.Builder( KEY_NAME, KeyProperties.PURPOSE_ENCRYPT or KeyProperties.PURPOSE_DECRYPT) .setBlockModes(KeyProperties.BLOCK_MODE_CBC) .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_PKCS7) .setUserAuthenticationRequired(true) // Invalidate the keys if the user has registered a new biometric // credential, such as a new fingerprint. Can call this method only // on Android 7.0 (API level 24) or higher. The variable // "invalidatedByBiometricEnrollment" is true by default. .setInvalidatedByBiometricEnrollment(true) .build())
Java
generateSecretKey(new KeyGenParameterSpec.Builder( KEY_NAME, KeyProperties.PURPOSE_ENCRYPT | KeyProperties.PURPOSE_DECRYPT) .setBlockModes(KeyProperties.BLOCK_MODE_CBC) .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_PKCS7) .setUserAuthenticationRequired(true) // Invalidate the keys if the user has registered a new biometric // credential, such as a new fingerprint. Can call this method only // on Android 7.0 (API level 24) or higher. The variable // "invalidatedByBiometricEnrollment" is true by default. .setInvalidatedByBiometricEnrollment(true) .build());
Şifre içeren bir biyometrik kimlik doğrulama iş akışı başlatın:
Kotlin
biometricLoginButton.setOnClickListener { // Exceptions are unhandled within this snippet. val cipher = getCipher() val secretKey = getSecretKey() cipher.init(Cipher.ENCRYPT_MODE, secretKey) biometricPrompt.authenticate(promptInfo, BiometricPrompt.CryptoObject(cipher)) }
Java
biometricLoginButton.setOnClickListener(view -> { // Exceptions are unhandled within this snippet. Cipher cipher = getCipher(); SecretKey secretKey = getSecretKey(); cipher.init(Cipher.ENCRYPT_MODE, secretKey); biometricPrompt.authenticate(promptInfo, new BiometricPrompt.CryptoObject(cipher)); });
Biyometrik kimlik doğrulama geri çağırmalarınızda hassas bilgileri şifrelemek için gizli anahtarı kullanın:
Kotlin
override fun onAuthenticationSucceeded( result: BiometricPrompt.AuthenticationResult) { val encryptedInfo: ByteArray = result.cryptoObject.cipher?.doFinal( // plaintext-string text is whatever data the developer would like // to encrypt. It happens to be plain-text in this example, but it // can be anything plaintext-string.toByteArray(Charset.defaultCharset()) ) Log.d("MY_APP_TAG", "Encrypted information: " + Arrays.toString(encryptedInfo)) }
Java
@Override public void onAuthenticationSucceeded( @NonNull BiometricPrompt.AuthenticationResult result) { // NullPointerException is unhandled; use Objects.requireNonNull(). byte[] encryptedInfo = result.getCryptoObject().getCipher().doFinal( // plaintext-string text is whatever data the developer would like // to encrypt. It happens to be plain-text in this example, but it // can be anything plaintext-string.getBytes(Charset.defaultCharset())); Log.d("MY_APP_TAG", "Encrypted information: " + Arrays.toString(encryptedInfo)); }
Biyometrik veya kilit ekranı kimlik bilgilerini kullanarak kimliğinizi doğrulayın.
Biyometrik kimlik bilgileri veya kilit ekranı kimlik bilgileri (PIN, desen veya şifre) kullanılarak kimlik doğrulamaya olanak tanıyan bir gizli anahtar kullanabilirsiniz. Bu anahtarı yapılandırırken geçerlilik süresini belirtin. Bu süre zarfında uygulamanız, kullanıcının yeniden kimlik doğrulaması yapmasına gerek kalmadan birden fazla kriptografik işlem gerçekleştirebilir.
Kullanıcı, biyometrik veya kilit ekranı kimlik bilgilerini kullanarak kimliğini doğruladıktan sonra hassas bilgileri şifrelemek için aşağıdaki adımları tamamlayın:
Aşağıdaki yapılandırmayı
KeyGenParameterSpec
kullanan bir anahtar oluşturun:Kotlin
generateSecretKey(KeyGenParameterSpec.Builder( KEY_NAME, KeyProperties.PURPOSE_ENCRYPT or KeyProperties.PURPOSE_DECRYPT) .setBlockModes(KeyProperties.BLOCK_MODE_CBC) .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_PKCS7) .setUserAuthenticationRequired(true) .setUserAuthenticationParameters(VALIDITY_DURATION_SECONDS, ALLOWED_AUTHENTICATORS) .build())
Java
generateSecretKey(new KeyGenParameterSpec.Builder( KEY_NAME, KeyProperties.PURPOSE_ENCRYPT | KeyProperties.PURPOSE_DECRYPT) .setBlockModes(KeyProperties.BLOCK_MODE_CBC) .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_PKCS7) .setUserAuthenticationRequired(true) .setUserAuthenticationParameters(VALIDITY_DURATION_SECONDS, ALLOWED_AUTHENTICATORS) .build());
Kullanıcı kimlik doğruladıktan sonraki
VALIDITY_DURATION_SECONDS
zaman aralığında hassas bilgileri şifreleyin:Kotlin
private fun encryptSecretInformation() { // Exceptions are unhandled for getCipher() and getSecretKey(). val cipher = getCipher() val secretKey = getSecretKey() try { cipher.init(Cipher.ENCRYPT_MODE, secretKey) val encryptedInfo: ByteArray = cipher.doFinal( // plaintext-string text is whatever data the developer would // like to encrypt. It happens to be plain-text in this example, // but it can be anything plaintext-string.toByteArray(Charset.defaultCharset())) Log.d("MY_APP_TAG", "Encrypted information: " + Arrays.toString(encryptedInfo)) } catch (e: InvalidKeyException) { Log.e("MY_APP_TAG", "Key is invalid.") } catch (e: UserNotAuthenticatedException) { Log.d("MY_APP_TAG", "The key's validity timed out.") biometricPrompt.authenticate(promptInfo) }
Java
private void encryptSecretInformation() { // Exceptions are unhandled for getCipher() and getSecretKey(). Cipher cipher = getCipher(); SecretKey secretKey = getSecretKey(); try { // NullPointerException is unhandled; use Objects.requireNonNull(). ciper.init(Cipher.ENCRYPT_MODE, secretKey); byte[] encryptedInfo = cipher.doFinal( // plaintext-string text is whatever data the developer would // like to encrypt. It happens to be plain-text in this example, // but it can be anything plaintext-string.getBytes(Charset.defaultCharset())); } catch (InvalidKeyException e) { Log.e("MY_APP_TAG", "Key is invalid."); } catch (UserNotAuthenticatedException e) { Log.d("MY_APP_TAG", "The key's validity timed out."); biometricPrompt.authenticate(promptInfo); } }
Kullanım başına kimlik doğrulama anahtarlarını kullanarak kimlik doğrulama
BiometricPrompt
örneğinizde kullanım başına kimlik doğrulama anahtarları için destek sağlayabilirsiniz. Bu tür bir anahtar, uygulamanızın anahtarla korunan verilere her erişmesi gerektiğinde kullanıcının biyometrik kimlik bilgisi veya cihaz kimlik bilgisi sunmasını gerektirir. Kullanım başına kimlik doğrulama anahtarları, büyük bir ödeme yapmak veya bir kişinin sağlık kayıtlarını güncellemek gibi yüksek değerli işlemler için yararlı olabilir.
Bir BiometricPrompt
nesnesini kullanıma göre kimlik doğrulama anahtarıyla ilişkilendirmek için aşağıdakine benzer bir kod ekleyin:
Kotlin
val authPerOpKeyGenParameterSpec = KeyGenParameterSpec.Builder("myKeystoreAlias", key-purpose) // Accept either a biometric credential or a device credential. // To accept only one type of credential, include only that type as the // second argument. .setUserAuthenticationParameters(0 /* duration */, KeyProperties.AUTH_BIOMETRIC_STRONG or KeyProperties.AUTH_DEVICE_CREDENTIAL) .build()
Java
KeyGenParameterSpec authPerOpKeyGenParameterSpec = new KeyGenParameterSpec.Builder("myKeystoreAlias", key-purpose) // Accept either a biometric credential or a device credential. // To accept only one type of credential, include only that type as the // second argument. .setUserAuthenticationParameters(0 /* duration */, KeyProperties.AUTH_BIOMETRIC_STRONG | KeyProperties.AUTH_DEVICE_CREDENTIAL) .build();
Açık kullanıcı işlemi olmadan kimlik doğrulama
Sistem, varsayılan olarak kullanıcıların biyometrik kimlik bilgileri kabul edildikten sonra belirli bir işlemi (ör. düğmeye basma) gerçekleştirmesini gerektirir. Uygulamanız, satın alma işlemi yapma gibi hassas veya yüksek riskli bir işlemi onaylamak için iletişim kutusu gösteriyorsa bu yapılandırma tercih edilir.
Ancak uygulamanız daha düşük riskli bir işlem için biyometrik kimlik doğrulama iletişim kutusu gösteriyorsa sisteme, kullanıcının kimlik doğrulamayı onaylaması gerekmediğiyle ilgili bir ipucu verebilirsiniz. Bu ipucu, kullanıcının yüz veya iris tabanlı tanıma gibi pasif bir yöntemle yeniden kimlik doğrulama yaptıktan sonra uygulamanızdaki içeriği daha hızlı görüntülemesine olanak tanıyabilir. Bu ipucunu sağlamak için false
değerini setConfirmationRequired()
yöntemine iletin.
Şekil 2'de aynı iletişim kutusunun iki sürümü gösterilmektedir. Bir sürüm için açık bir kullanıcı işlemi gerekirken diğer sürüm için gerekmez.
Aşağıdaki kod snippet'inde, kimlik doğrulama işleminin tamamlanması için açık bir kullanıcı işlemi gerektirmeyen bir iletişim kutusunun nasıl gösterileceği açıklanmaktadır:
Kotlin
// Lets the user authenticate without performing an action, such as pressing a // button, after their biometric credential is accepted. promptInfo = BiometricPrompt.PromptInfo.Builder() .setTitle("Biometric login for my app") .setSubtitle("Log in using your biometric credential") .setNegativeButtonText("Use account password") .setConfirmationRequired(false) .build()
Java
// Lets the user authenticate without performing an action, such as pressing a // button, after their biometric credential is accepted. promptInfo = new BiometricPrompt.PromptInfo.Builder() .setTitle("Biometric login for my app") .setSubtitle("Log in using your biometric credential") .setNegativeButtonText("Use account password") .setConfirmationRequired(false) .build();
Biyometrik olmayan kimlik bilgilerine geri dönüşe izin ver
Uygulamanızın biyometrik veya cihaz kimlik bilgileri kullanılarak kimlik doğrulamaya izin vermesini istiyorsanız setAllowedAuthenticators()
'a ilettiğiniz değerler kümesine DEVICE_CREDENTIAL
ekleyerek uygulamanızın cihaz kimlik bilgilerini desteklediğini belirtebilirsiniz.
Uygulamanız şu anda bu özelliği sağlamak için
createConfirmDeviceCredentialIntent()
veya setDeviceCredentialAllowed()
kullanıyorsa setAllowedAuthenticators()
kullanmaya geçin.
Ek kaynaklar
Android'de biyometrik kimlik doğrulama hakkında daha fazla bilgi edinmek için aşağıdaki kaynaklara göz atın.