Skip to content

Commit e6fed4d

Browse files
authored
Add flight to preferImmediatelyAvailableCredentials (#2514)
### Summary Need to wrap the `preferImmediatelyAvailableCredentials` parameter with the flight as well.
1 parent 4d44e18 commit e6fed4d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

common/src/main/java/com/microsoft/identity/common/internal/fido/CredManFidoManager.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ import androidx.credentials.GetCredentialRequest
2929
import androidx.credentials.GetPublicKeyCredentialOption
3030
import androidx.credentials.PublicKeyCredential
3131
import androidx.credentials.exceptions.NoCredentialException
32+
import com.microsoft.identity.common.java.flighting.CommonFlight
33+
import com.microsoft.identity.common.java.flighting.CommonFlightsManager.getFlightsProvider
3234
import com.microsoft.identity.common.java.opentelemetry.AttributeName
3335
import com.microsoft.identity.common.logging.Logger
3436
import io.opentelemetry.api.trace.Span
@@ -82,7 +84,7 @@ class CredManFidoManager (val context: Context,
8284
// We're setting preferImmediatelyAvailableCredentials in the CredMan getCredentialRequest object to true if the device OS is Android 13 or lower.
8385
// This ensures the behavior where no dialog from CredMan is shown if no passkey cred is present.
8486
// The end goal is for an Android <= 13 user who only has a security key to see one dialog which will allow them to authenticate.
85-
preferImmediatelyAvailableCredentials = (Build.VERSION.SDK_INT < Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
87+
preferImmediatelyAvailableCredentials = (getFlightsProvider().isFlightEnabled(CommonFlight.ENABLE_LEGACY_FIDO_SECURITY_KEY_LOGIC) && Build.VERSION.SDK_INT < Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
8688
)
8789
try {
8890
Logger.info(methodTag, "Calling Credential Manager with a GetCredentialRequest.")

0 commit comments

Comments
 (0)