@@ -886,13 +886,11 @@ internal class AuthgearCore(
886886 }
887887
888888 @RequiresApi(api = Build .VERSION_CODES .M )
889- fun checkBiometricSupported (context : Context , allowed : Int ) {
889+ fun checkBiometricSupported (context : Context , allowedAuthenticatorsOnEnable : List < BiometricAuthenticator > ) {
890890 requireIsInitialized()
891891 requireMinimumBiometricAPILevel()
892892
893- var allowed = allowed
894- ensureAllowedIsValid(allowed)
895- allowed = convertAllowed(allowed)
893+ val allowed = convertAllowed(allowedAuthenticatorsOnEnable)
896894 val result = BiometricManager .from(context).canAuthenticate(allowed)
897895 if (result != BiometricManager .BIOMETRIC_SUCCESS ) {
898896 throw wrapException(BiometricCanAuthenticateException (result))
@@ -931,21 +929,22 @@ internal class AuthgearCore(
931929 val accessToken: String = this .accessToken
932930 ? : throw UnauthenticatedUserException ()
933931
934- ensureAllowedIsValid(options.allowedAuthenticators)
935- val allowed = convertAllowed(options.allowedAuthenticators)
932+ val allowedAuthenticatorsOnEnable = convertAllowed(options.allowedAuthenticatorsOnEnable)
933+ val allowedAuthenticatorsOnAuthenticate = convertAllowed(options.allowedAuthenticatorsOnAuthenticate)
934+
936935 val promptInfo = buildPromptInfo(
937936 options.title,
938937 options.subtitle,
939938 options.description,
940939 options.negativeButtonText,
941- allowed
940+ allowedAuthenticatorsOnEnable
942941 )
943942
944943 val kid = UUID .randomUUID().toString()
945944 val alias = " com.authgear.keys.biometric.$kid "
946945 val spec = makeGenerateKeyPairSpec(
947946 alias,
948- authenticatorTypesToKeyProperties(allowed ),
947+ authenticatorTypesToKeyProperties(allowedAuthenticatorsOnAuthenticate ),
949948 options.invalidatedByBiometricEnrollment)
950949 val challenge = this .oauthRepo.oauthChallenge(" biometric_request" ).token
951950 val keyPair = createKeyPair(spec)
@@ -1019,14 +1018,13 @@ internal class AuthgearCore(
10191018 requireIsInitialized()
10201019 requireMinimumBiometricAPILevel()
10211020
1022- ensureAllowedIsValid(options.allowedAuthenticators)
1023- val allowed = convertAllowed(options.allowedAuthenticators)
1021+ val allowedAuthenticatorsOnAuthenticate = convertAllowed(options.allowedAuthenticatorsOnAuthenticate)
10241022 val promptInfo = buildPromptInfo(
10251023 options.title,
10261024 options.subtitle,
10271025 options.description,
10281026 options.negativeButtonText,
1029- allowed
1027+ allowedAuthenticatorsOnAuthenticate
10301028 )
10311029
10321030 val challenge = this .oauthRepo.oauthChallenge(" biometric_request" ).token
0 commit comments