Skip to content

Conversation

@AdamVe
Copy link
Member

@AdamVe AdamVe commented Jan 30, 2026

Summary

Introduces a new fido-android-ui module that provides a high-level Kotlin API for performing FIDO2/WebAuthn operations using hardware security keys (YubiKey or other FIDO2-compatible authenticators).

Key Features

  • Simple WebAuthn API - FidoClient handles the complete FIDO operation lifecycle including device communication, PIN entry, and user interaction
  • WebView Integration - Enable hardware-backed WebAuthn in any WebView with a single extension function
  • Customizable UI - Configure PIN priority, apply custom Compose themes, and manage FIDO extensions globally via FidoConfigManager
  • Coroutine Support - Suspending functions with proper lifecycle management via Activity Result API
  • Java Interoperability - Full @JvmOverloads support for Java consumers

Usage

// Create client during Activity/Fragment initialization
val fidoClient = FidoClient(this)

// Registration
val result = fidoClient.makeCredential(origin, requestJson, null)

// Authentication  
val result = fidoClient.getAssertion(origin, requestJson, null)

// WebView support
webView.enableFidoWebauthn(lifecycleScope, fidoClient)

Configuration

FidoConfigManager.setIsPinPrioritized(true)
FidoConfigManager.setExtensions(listOf(LargeBlobExtension()))
FidoConfigManager.setTheme { content -> MyAppTheme { content() } }

@AdamVe AdamVe requested a review from Copilot January 30, 2026 07:58
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new fido-android-ui module that provides a high-level Kotlin API for performing FIDO2/WebAuthn operations using hardware security keys. The module includes a complete UI implementation using Jetpack Compose, WebView integration support, and coroutine-based async operations.

Changes:

  • New fido-android-ui module with FidoClient API, Compose UI screens, and WebView support
  • USB FIDO device detection improvements to filter by HID usage page
  • Updates to testing infrastructure and build configuration
  • AndroidDemo app integration examples for both WebView and native app usage

Reviewed changes

Copilot reviewed 94 out of 98 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
fido-android-ui/* Complete new module with FidoClient, Compose UI, WebView integration, and configuration management
android/src/main/java/com/yubico/yubikit/android/transport/usb/* Enhanced USB FIDO interface detection using HID report descriptors
gradle/libs.versions.toml Added dependencies for Compose, AndroidX libraries, and testing frameworks
settings.gradle.kts Registered fido-android-ui module
scripts/spotless.py Enhanced to format only staged files with Kotlin support
AndroidDemo/* Added FIDO WebView and native app demo fragments

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

int reportDescLength = DEFAULT_REPORT_DESC_SIZE;
try {
reportDescLength = getReportDescriptorLength(connection, interfaceId);
} catch (Exception ignore) {
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable name ignore should be ignored to follow Java naming conventions for intentionally ignored exception variables.

Suggested change
} catch (Exception ignore) {
} catch (Exception ignored) {

Copilot uses AI. Check for mistakes.
int interfaceId,
byte[] buffer,
int bufferLength) {
int wValue = (descriptorType << 8) | HID_DESCRIPTOR_INDEX;

Check notice

Code scanning / SpotBugs

Vacuous bit mask operation on integer value. Note

Vacuous bit mask operation on integer value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants