Build an iOS passkey sign-in flow in Rust

Inspect real passkey support without fabricating a challenge or session. Native iOS sign-in remains blocked by the provider and server integrations.
iOS

What you will build

Expose the missing native and relying-party requirements before claiming that an iOS passkey can authenticate an account.
Decode the active host's real passkey-availability response
Separate Apple domain association from the missing credential adapter
Require a fresh server challenge and verified assertion before any session is accepted
Status: blocked — this is not a completed iOS passkey sign-in flow. The current iOS shell uses UnsupportedPasskeyHost, not an AuthenticationServices provider. The application also needs a real server challenge and assertion-verification endpoint before it can authenticate anyone.
A passkey assertion is not a session. The host gathers credential data; the relying-party server verifies it and decides whether access is allowed. The diagnostic below checks actual host support without generating a challenge locally, fabricating an assertion or displaying a successful sign-in.

Create a diagnostic project, not a simulated feature

Complete iOS setup first. These commands declare the capability and generate platform inputs; they do not remove the native provider gap.
cargo install cargo-fission
fission init ios-add-passkey-sign-in-to-an-ios-app
cd ios-add-passkey-sign-in-to-an-ios-app
fission add-target ios --project-dir .
fission add-capability passkeys --project-dir .
cargo add serde_yaml

Run the finished example

fission run --target ios --project-dir .

1. Ask the actual provider

Keep the generated src/main.rs and replace the shared files below. The view is side-effect-free; the explicit button queues one request, binds both unit completion actions and decodes the actual typed response. Neither the normal launcher nor the preview installs a memory provider.
{"id":"fission-tabs-1","tabs":[{"index":0,"label":"src/app.rs","value":"src-app-rs"},{"index":1,"label":"src/app/state.rs","value":"src-app-state-rs"},{"index":2,"label":"src/app/screen.rs","value":"src-app-screen-rs"},{"index":3,"label":"src/i18n.rs","value":"src-i18n-rs"},{"index":4,"label":"src/lib.rs","value":"src-lib-rs"},{"index":5,"label":"preview/lib.rs","value":"preview-lib-rs"},{"index":6,"label":"i18n/en-US.yaml","value":"i18n-en-us-yaml"},{"index":7,"label":"i18n/es-ES.yaml","value":"i18n-es-es-yaml"}]}
{"id":"fission-tabs-1","index":0,"label":"src/app.rs","value":"src-app-rs"}
mod screen;
pub mod state;
pub use screen::PasskeyDiagnosticScreen;
pub use state::PasskeyDiagnosticState;
{"id":"fission-tabs-1","index":1,"label":"src/app/state.rs","value":"src-app-state-rs"}
use fission::prelude::*;

#[derive(Clone, Debug, PartialEq, Eq)]
pub struct PasskeyDiagnosticState {
    pub locale: Locale,
    pub pending: bool,
    pub message_key: String,
    pub diagnostic: Option<String>,
}
impl Default for PasskeyDiagnosticState {
    fn default() -> Self {
        Self {
            locale: Locale::from("en-US"),
            pending: false,
            message_key: "check.ready".into(),
            diagnostic: None,
        }
    }
}
impl GlobalState for PasskeyDiagnosticState {}

pub fn check_host(
    state: &mut PasskeyDiagnosticState,
    cx: &mut ReducerContext<PasskeyDiagnosticState>,
) {
    if state.pending {
        return;
    }
    state.pending = true;
    state.message_key = "check.pending".into();
    state.diagnostic = None;
    let ok = cx.effects.bind(HostChecked, reduce_with!(host_checked));
    let err = cx
        .effects
        .bind(HostCheckFailed, reduce_with!(host_check_failed));
    cx.effects.passkeys().availability().on_ok(ok).on_err(err);
}

#[fission_reducer(HostChecked)]
fn host_checked(
    state: &mut PasskeyDiagnosticState,
    cx: &mut ReducerContext<PasskeyDiagnosticState>,
) {
    state.pending = false;
    match cx.input.capability_ok(GET_PASSKEY_AVAILABILITY) {
        Some(value) => {
            state.message_key = if value.supported && value.secure_context {
                "check.available"
            } else {
                "check.unavailable"
            }
            .into();
            state.diagnostic = Some(format!("{value:?}"));
        }
        None => state.message_key = "check.invalid".into(),
    }
}

#[fission_reducer(HostCheckFailed)]
fn host_check_failed(
    state: &mut PasskeyDiagnosticState,
    cx: &mut ReducerContext<PasskeyDiagnosticState>,
) {
    state.pending = false;
    match cx.input.capability_error(GET_PASSKEY_AVAILABILITY) {
        Some(error) => {
            state.message_key = if error.code == "unsupported" {
                "check.unavailable"
            } else {
                "check.failed"
            }
            .into();
            state.diagnostic = Some(format!("{}: {}", error.code, error.message));
        }
        None => state.message_key = "check.invalid".into(),
    }
}
{"id":"fission-tabs-1","index":2,"label":"src/app/screen.rs","value":"src-app-screen-rs"}
use super::state::{check_host, PasskeyDiagnosticState};
use fission::prelude::*;

fission_component! {
    pub PasskeyDiagnosticScreen<PasskeyDiagnosticState> {}
    view(_screen, state, cx) {
        let tokens = &cx.view.env().theme.tokens;
    } => SafeArea(child: Scroll(child: Container(
        Column(gap: tokens.spacing.m, children: [
            Text(cx.tr("check.heading")).size(tokens.typography.heading2_size),
            Text(cx.tr("check.blocked")).color(tokens.colors.text_secondary),
            Row(gap: tokens.spacing.s, children: [
                Button(child: Text(cx.tr("language.english")), key: "english",
                    on_press: reduce { state.locale = Locale::from("en-US"); }),
                Button(child: Text(cx.tr("language.spanish")), key: "spanish",
                    on_press: reduce { state.locale = Locale::from("es-ES"); }),
            ]),
            Button(child: Text(cx.tr("check.request")), key: "check-host", disabled: state.pending,
                on_press: reduce { check_host(state, cx); })
                .semantics_identifier("host.check"),
            if state.pending {
                Spinner(motion: Some(SpinnerMotion::Default), label: Some(cx.tr("check.pending")))
            },
            Text(cx.tr(&state.message_key)),
            if let Some(details) = &state.diagnostic { Code(text: details.clone()) },
            Text(cx.tr("check.scope")).color(tokens.colors.text_secondary),
        ])
    ).padding_all(tokens.spacing.l)))
}
{"id":"fission-tabs-1","index":3,"label":"src/i18n.rs","value":"src-i18n-rs"}
use fission::i18n::{Locale, TranslationBundle};
use fission::prelude::*;
use std::collections::HashMap;

pub fn create_env() -> Env {
    let mut env = Env::default();
    env.locale = Locale::from("en-US");
    for (locale, source) in [
        ("en-US", include_str!("../i18n/en-US.yaml")),
        ("es-ES", include_str!("../i18n/es-ES.yaml")),
    ] {
        let messages: HashMap<String, String> =
            serde_yaml::from_str(source).expect("valid task translations");
        env.i18n.add_bundle(TranslationBundle {
            locale: Locale::from(locale),
            messages,
        });
    }
    env
}

pub fn sync_env(state: &crate::app::PasskeyDiagnosticState, env: &mut Env) {
    env.locale = state.locale.clone();
}
{"id":"fission-tabs-1","index":4,"label":"src/lib.rs","value":"src-lib-rs"}
pub mod app;
mod i18n;

use app::{PasskeyDiagnosticScreen, PasskeyDiagnosticState};
use fission::prelude::*;

#[cfg(not(any(target_arch = "wasm32", target_os = "android", target_os = "ios")))]
pub fn run_desktop() -> anyhow::Result<()> {
    DesktopApp::<PasskeyDiagnosticState, _>::new(PasskeyDiagnosticScreen)
        .with_env(i18n::create_env())
        .with_sync_env(i18n::sync_env)
        .run()
}

#[cfg(any(target_os = "android", target_os = "ios"))]
pub fn run_mobile() -> anyhow::Result<()> {
    MobileApp::<PasskeyDiagnosticState, _>::new(PasskeyDiagnosticScreen)
        .with_env(i18n::create_env())
        .with_sync_env(i18n::sync_env)
        .run()
}

#[cfg(target_os = "android")]
#[no_mangle]
fn android_main(app_handle: AndroidApp) {
    let _ = MobileApp::<PasskeyDiagnosticState, _>::new(PasskeyDiagnosticScreen)
        .with_env(i18n::create_env())
        .with_sync_env(i18n::sync_env)
        .run_with_android_app(app_handle);
}

#[cfg(target_arch = "wasm32")]
#[wasm_bindgen::prelude::wasm_bindgen(start)]
pub fn run_web() -> Result<(), wasm_bindgen::JsValue> {
    console_error_panic_hook::set_once();
    WebApp::<PasskeyDiagnosticState, _>::new(PasskeyDiagnosticScreen)
        .with_env(i18n::create_env())
        .with_sync_env(i18n::sync_env)
        .run()
        .map_err(|error| wasm_bindgen::JsValue::from_str(&error.to_string()))
}
{"id":"fission-tabs-1","index":5,"label":"preview/lib.rs","value":"preview-lib-rs"}
mod app;
mod i18n;

use fission::prelude::*;
use wasm_bindgen::prelude::*;

#[wasm_bindgen(start)]
pub fn run() -> Result<(), JsValue> {
    console_error_panic_hook::set_once();
    WebApp::<app::PasskeyDiagnosticState, _>::new(app::PasskeyDiagnosticScreen)
        .with_env(i18n::create_env())
        .with_sync_env(i18n::sync_env)
        .mount("#fission-web-mount")
        .run()
        .map_err(|error| JsValue::from_str(&error.to_string()))
}
{"id":"fission-tabs-1","index":6,"label":"i18n/en-US.yaml","value":"i18n-en-us-yaml"}
check.heading: "Check passkey prerequisites"
check.blocked: "The native iOS tutorial goal is blocked. This screen checks a prerequisite; it does not implement the promised feature."
check.request: "Check the active host"
check.ready: "No host check has been requested."
check.pending: "Waiting for the host…"
check.available: "This host reports secure passkey support. Nobody has been signed in."
check.unavailable: "The active host cannot provide this prerequisite or operation."
check.failed: "The host check failed. Inspect the diagnostic details."
check.invalid: "The host returned no usable typed result."
check.scope: "This is an integration diagnostic, not a completed native workflow."
language.english: "English"
language.spanish: "Español"
{"id":"fission-tabs-1","index":7,"label":"i18n/es-ES.yaml","value":"i18n-es-es-yaml"}
check.heading: "Comprueba los requisitos de claves de acceso"
check.blocked: "El objetivo nativo de iOS está bloqueado. Esta pantalla comprueba un requisito; no implementa la función prometida."
check.request: "Comprobar el host activo"
check.ready: "No se ha solicitado ninguna comprobación."
check.pending: "Esperando al host…"
check.available: "Este host indica compatibilidad segura con claves de acceso. Nadie ha iniciado sesión."
check.unavailable: "El host activo no puede proporcionar este requisito u operación."
check.failed: "La comprobación falló. Revisa los detalles de diagnóstico."
check.invalid: "El host no devolvió un resultado tipado utilizable."
check.scope: "Es un diagnóstico de integración, no un flujo nativo completo."
language.english: "Inglés"
language.spanish: "Español"
{"id":"fission-tabs-1"}
Run the host check. Inspect the actual response and the blocked-goal notice together. A successful request transport is not proof that the requested capability exists.
Show the app preview
Hide the app preview

2. Keep the missing integration visible

The availability query can succeed and still report supported: false. That is the normal iOS provider's current result. A secure browser may report support, but this does not implement the missing native adapter or your server's authentication policy.
For a real deployment, choose a relying-party domain which the service owns. Configure the signed app's Associated Domains with webcredentials:<your-domain> and serve the corresponding apple-app-site-association document from that domain. Do not copy a demonstration domain into a production identity configuration. These platform associations and a genuine AuthenticationServices adapter are separate prerequisites.
The server must issue a fresh, expiring challenge and verify the returned assertion against the expected challenge, relying-party identity, origin/application association, credential and account policy before creating a session. Reuse a maintained WebAuthn implementation for that work. Cancellation leaves the user signed out; an availability result or credential response alone never unlocks protected content.
This page deliberately stops before those missing contracts. The native sign-in goal remains blocked rather than being renamed to a simulated success.
Retry the check and change language. There must be no fabricated record, credential, saved setting or completed operation. The diagnostic output is developer evidence, not a user-facing success receipt.
Show the app preview
Hide the app preview

3. What still has to be established

On macOS, launch the actual generated iOS host:
fission doctor ios --project-dir .
fission devices --project-dir .
fission run --target ios --project-dir .
fission test --target ios --project-dir .
These commands can check setup and launch. They cannot certify a missing provider. Follow physical iPhone installation when the real native integration is available.
A completed version must demonstrate the real server challenge/verification round trip and native credential prompt on a signed iPhone build. Test cancellation, no matching credential, expired or replayed challenge, verification failure and returning to the intended protected route only after a verified session exists. Do not publish a test provider as an authentication fallback.