Package 

Object FidoConfigManager


  • 
    public class FidoConfigManager
    
                        

    Global manager for FIDO UI configuration.

    This singleton provides methods to read and modify the configuration that controls FIDO operation behavior and UI presentation. Configuration changes are applied globally and affect all FidoClient instances.

    Reading configuration:

    // Get current snapshot
    val config = FidoConfigManager.current
    
    // Observe changes reactively
    FidoConfigManager.configuration.collect { config ->
        // React to configuration changes
    }

    Modifying configuration:

    // Set individual properties
    FidoConfigManager.setIsPinPrioritized(true)
    FidoConfigManager.setExtensions(listOf(LargeBlobExtension()))
    FidoConfigManager.setTheme { content -> MyAppTheme { content() } }
    
    // Or update atomically
    FidoConfigManager.update { config ->
        config.copy(isPinPrioritized = true, fidoExtensions = listOf(...))
    }
    
    // Or replace entirely
    FidoConfigManager.replace(FidoConfig(isPinPrioritized = true))

    Thread safety:

    All operations are thread-safe. The configuration flow emits updates atomically.

    • Method Detail

      • setIsPinPrioritized

         final Unit setIsPinPrioritized(Boolean value)

        Sets whether PIN entry should be prioritized before security key interaction.

        Parameters:
        value - true to show PIN entry first, false to prompt for key touch first.
      • setExtensions

         final Unit setExtensions(List<Extension> extensions)

        Sets the FIDO extensions to enable for all operations.

        Parameters:
        extensions - List of Extension instances to enable, or null to use the default set of extensions provided by the CTAP2 client.
      • setTheme

         final Unit setTheme(Function1<Function0<Unit>, Unit> theme)

        Sets a custom Compose theme for the FIDO UI screens.

        Parameters:
        theme - A composable function that wraps content with your theme, or null to use the default theme.
      • setIsCustomThemeEnabled

         final Unit setIsCustomThemeEnabled(Boolean value)

        Sets whether to use a custom theme for the FIDO UI screens.

        Parameters:
        value - true to use custom theme, false to use default theme.
      • update

         final Unit update(Function1<FidoConfig, FidoConfig> transform)

        Atomically updates the configuration using a transform function.

        This is useful when you need to modify multiple properties based on the current configuration state.

        Parameters:
        transform - A function that receives the current config and returns the new config.
      • replace

         final Unit replace(FidoConfig configuration)

        Replaces the entire configuration with a new value.

        Parameters:
        configuration - The new FidoConfig to set.