Skip to content

Latest commit

 

History

History
352 lines (341 loc) · 72.1 KB

AuthenticationServices.md

File metadata and controls

352 lines (341 loc) · 72.1 KB

AuthenticationServices

Symbols: 55.5% of Apple's iOS API (599 of 1080, exact) · Rows: 18: 15 ✅ 3 ❌ · iOS: 12.0+

Area: Identity & security · Apple: AuthenticationServices · Issues: area:security

How isim implements it

  • Adapted:
    • Sign in with Apple uses a local account and an unsigned JWT;
    • ASWebAuthenticationSession runs on isim's WKWebView;
    • passkeys are CryptoKit P-256 keys in the device data;
    • app extensions (credential providers, SSO, account modification) run in the process of the app that asks, as isim's share and keyboard extensions do; on iOS each runs in its own process.

API

API / feature Status iOS Notes
Sign in with Apple (ASAuthorizationAppleIDProvider, ASAuthorizationController, ASAuthorizationAppleIDButton, SignInWithAppleButton) ✅ ≤17 local simulation, no Apple servers: iOS-style sheet (Apple ID / Apple Account wording by ISIM_OS_VERSION, name, Share/Hide My Email, Continue/close) for a fake account in the device data; returning users get the short sheet without name/email. identityToken is an unsigned JWT (alg: none, issuer isim-local-simulation) and authorizationCode a random local string — servers that verify Apple signatures reject them. getCredentialState authorized/revoked/notFound per app; isim appleid <app> revoke posts credentialRevokedNotification to the running app. Buttons: black/white/whiteOutline, sign in/continue/sign up, isim-drawn logo. Tested: HelloSignIn
ASWebAuthenticationSession (OAuth) ✅ ≤17 iOS's “Wants to Use … to Sign In” alert (skipped when ephemeral), the page in a browser sheet on isim's WKWebView (real WebKit), callback by custom scheme or (iOS 17.4) https host+path — links, forms and server redirects; Cancel → canceledLogin; presentationContextProvider errors; SwiftUI webAuthenticationSession environment action. Tested against a local OAuth page (HelloSafari). Non-ephemeral sessions share SFSafariViewController's in-memory data, not Safari's
Passkeys (ASAuthorizationPlatformPublicKeyCredentialProvider registration + assertion) ✅ ≤17 real WebAuthn data: P-256 key (CryptoKit), CBOR attestation object with format none (AAGUID zero, COSE key), clientDataJSON with origin https://<rp>, assertion signature over authData ‖ SHA-256(clientDataJSON) that verifies. Keys kept unencrypted in the device data (not synced). iOS-style save/sign-in sheets; no passkey → canceled (no nearby-device QR); preferImmediatelyAvailableCredentials → notInteractive. Security keys (ASAuthorizationSecurityKey…), PRF/large blob missing. Tested: HelloSignIn
Password sign-in (ASAuthorizationPasswordProvider, ASPasswordCredential), AutoFill-assisted requests ✅ ≤17 adapted: the chooser sheet offers the app's internet passwords from isim's keychain and the device's Passwords store (filled by UIKit's QuickType AutoFill bar and "Save Password?", for the app's webcredentials: domains); performAutoFillAssistedRequests shows no sheet and offers the relying party's passkeys in the QuickType bar of .username fields, picking one completes the request (passkey assertion requests only, like iOS). No iCloud Keychain sync. Tested: HelloSignIn, test_text_services
Passkey extensions: PRF (ASAuthorizationPublicKeyCredentialPRFRegistrationInput / …PRFAssertionInput with InputValues, …PRFRegistrationOutput / …PRFAssertionOutput) and largeBlob (ASAuthorizationPublicKeyCredentialLargeBlobRegistrationInput / …AssertionInput, their outputs), the prf / largeBlob properties of the platform requests and credentials ✅ 17.0 adapted (largeBlob iOS 17, PRF iOS 18): each passkey gets a random 32-byte PRF secret when it is created, and an evaluation is HMAC-SHA-256(secret, SHA-256("WebAuthn PRF" ‖ 0x00 ‖ salt)), as WebAuthn defines it, so a credential and salt always give the same key (per-credential salts win over the default ones). The large blob (up to 2 KiB) is kept with the passkey in the device data. The Objective-C classes are Apple's (__ASAuthorization… in Swift). Tested: HelloSignIn (tests/ui/test_signin.py: the same PRF key at registration and sign-in, a blob written then read back from the QuickType bar), HelloAuthObjC
Security keys (ASAuthorizationSecurityKeyPublicKeyCredentialProvider, its registration and assertion requests and credentials, ASAuthorizationSecurityKeyPublicKeyCredentialDescriptor with Transport, ASAuthorizationPublicKeyCredentialParameters, ASCOSEAlgorithmIdentifier, ASAuthorizationPublicKeyCredentialResidentKeyPreference, the appID extension, PRF) ✅ ≤17 adapted: a virtual USB security key whose credentials (P-256, attestation "none", PRF secret) are kept in the device data (Library/isim/SecurityKey/<relying party>.json). Registration shows a "Set Up a Security Key" sheet where iOS asks to insert a key; sign-ins list the key's credentials in the chooser ("Security key · "): the allowed ones (also those registered under the request's appID, which sets appID on the assertion), else the discoverable ones (residentKeyPreference other than .discouraged). ES256 only; excludedCredentials matches fail with matchedExcludedCredential. No real security keys (USB, NFC, Bluetooth). Tested: HelloSignIn, HelloAuthObjC
Conditional passkey registration (ASAuthorizationPlatformPublicKeyCredentialRegistrationRequest.RequestStyle, requestStyle, createCredentialRegistrationRequest(challenge:name:userID:requestStyle:)) ✅ 18.0 adapted: a .conditional request shows no sheet. It creates the passkey when the app's saved passwords (keychain internet passwords, the device's Passwords store) have one for the account name; iOS also requires that password to have been used just before, which isim doesn't track. Otherwise it fails with ASAuthorizationError.failed (proposed: Apple doesn't document the code). After it, a "Passkey Saved" notification banner appears at the top of the screen (accessibility identifier as-banner). excludedCredentials are honoured for every passkey registration. Tested: HelloSignIn (refused without a saved password, then created with the banner; iOS 17: unavailable), HelloAuthObjC
SwiftUI AuthorizationController (EnvironmentValues.authorizationController: performRequest(s), with options:, customMethods:, performAutoFillAssistedRequest(s)), ASAuthorizationResult, ASAuthorizationCustomMethod ✅ ≤17 adapted: an ASAuthorizationController run from the key window, its result as an ASAuthorizationResult (or the error thrown). Custom methods are tvOS-only, so none are offered, as on iOS. ASAuthorizationController.customAuthorizationMethods is now [ASAuthorizationCustomMethod]; apps built before still reach the old [Any] property. Missing: ASAuthorizationResult.passkeyAccountCreation (iOS 26: its credential type is not in isim). Tested: HelloSignIn (a security key through authorizationController)
Objective-C interface (AuthenticationServices.framework, <AuthenticationServices/AuthenticationServices.h>): ASAuthorizationController and its delegate and presentation protocols, ASAuthorization, the Apple ID, password and platform passkey providers, requests and credentials, ASAuthorizationAppleIDButton, ASWebAuthenticationSession and ASWebAuthenticationSessionCallback, the error domains and codes, scopes, operations, user verification and attestation constants, ASAuthorizationAppleIDProviderCredentialRevokedNotification ✅ ≤17 adapted: Apple's Objective-C names and selectors over the Swift overlay's classes (the same local simulation); the framework re-exports libswiftAuthenticationServices. The presentation protocols use Apple's selectors (presentationAnchorForAuthorizationController:, presentationAnchorForWebAuthenticationSession:); providers in apps built before 0.27, which implement presentationAnchorFor:, still work. The classes are not subclassable from Objective-C; the credentials do not adopt NSCopying / NSSecureCoding; the revoked notification is watched once a provider exists. Tested: HelloAuthObjC (tests/ui/test_auth_objc.py: Sign in with Apple from the button, a passkey registered and asserted, notInteractive, the web session's alert cancelled with Apple's and the old selector)
Credential provider extensions (com.apple.authentication-services-credential-provider-ui): ASCredentialProviderViewController (prepareCredentialList(for:) with and without requestParameters, prepareOneTimeCodeCredentialList(for:), provideCredentialWithoutUserInteraction(for:), prepareInterfaceToProvideCredential(for:), prepareInterface(forPasskeyRegistration:), performWithoutUserInteractionIfPossible(passkeyRegistration:), prepareInterfaceForExtensionConfiguration(), prepareInterfaceForUserChoosingTextToInsert(), the report… calls), ASCredentialProviderExtensionContext (completeRequest(withSelectedCredential:), completeAssertionRequest(using:), completeRegistrationRequest(using:), completeOneTimeCodeRequest(using:), completeRequest(withTextToInsert:), completeExtensionConfigurationRequest(), cancelRequest(withError:)), ASCredentialRequest, ASPasswordCredentialRequest, ASPasskeyCredentialRequest, ASOneTimeCodeCredentialRequest, ASPasskeyCredentialRequestParameters, ASPasskeyAssertionCredential, ASPasskeyRegistrationCredential, ASOneTimeCodeCredential, ASCredentialRequestType, ASExtensionError ✅ ≤17 adapted: the extension runs in the app that asks. The QuickType bar of username, password and one-time-code fields offers an enabled provider's identities for the app's webcredentials: site; a pick runs the provider without its UI, and when it cancels with .userInteractionRequired presents it as a sheet after prepareInterfaceToProvideCredential(for:). ASAuthorizationController's chooser lists the provider's passkeys (isim makes the client data; the provider signs its hash). A passkey registration goes to an enabled provider that declares ProvidesPasskeys, instead of the device's own sheet. Not offered: the provider's list from the keyboard's key button, text insertion from the edit menu, extension configuration in Settings. Tested (tests/ui/test_vault.py::test_credential_provider: a password without UI, a locked one after the unlock screen, a one-time code, a passkey registered in the provider and asserted from it, verified with its public key)
ASCredentialIdentityStore (shared, getState, state(), save / remove / replace / remove all, with completions and async, credentialIdentities(forService:credentialIdentityTypes:), IdentityTypes), ASCredentialIdentityStoreState, ASCredentialIdentityStoreError, ASCredentialIdentity, ASPasswordCredentialIdentity, ASPasskeyCredentialIdentity, ASOneTimeCodeCredentialIdentity, ASCredentialServiceIdentifier (domain, URL, app), ASSettingsHelper ✅ ≤17 adapted: each provider's identities are kept in the device data (Library/isim/CredentialProviders/<extension>.json). A provider is off until it is turned on in Settings > Passwords > Password Options, by ASSettingsHelper.requestToTurnOnCredentialProviderExtension (iOS 18: a "Turn On AutoFill?" alert, `ISIM_AUTOFILL_PROVIDER_ANSWER=allow
Single sign-on: ASAuthorizationSingleSignOnProvider (init(identityProvider:), canPerformAuthorization, createRequest()), ASAuthorizationSingleSignOnRequest (authorizationOptions, isUserInterfaceEnabled), ASAuthorizationSingleSignOnCredential; the SSO extension's ASAuthorizationProviderExtensionAuthorizationRequestHandler, ASAuthorizationProviderExtensionAuthorizationRequest (url, requestedOperation, realm, extensionData, the caller, doNotHandle(), cancel(), complete(...), presentAuthorizationViewController(completion:)), ASAuthorizationProviderExtensionAuthorizationResult, ASAuthorizationProviderAuthorizationOperation ✅ ≤17 adapted: an MDM profile maps identity provider URLs to an SSO extension on iOS. isim keeps the mapping in the device data (isim sso add <extension> <url> [--realm R], isim sso list). The extension (com.apple.AppSSO.idp-extension) runs in the app; the identity provider URL gets the request's scope, state, nonce and options as query items. complete(httpAuthorizationHeaders:) gives an authenticatedResponse with those headers; complete(httpResponse:httpBody:) gives the response, with access_token / id_token from a JSON body. doNotHandle() fails with .notHandled, as does a URL no profile covers. Not intercepted: Safari, WebKit and URLSession requests to the identity provider. Platform SSO (ASAuthorizationProviderExtensionLoginManager) is macOS-only. Tested (test_vault.py::test_sso: no profile, tokens without UI, a header after the approval screen)
Account modification: ASAccountAuthenticationModificationController (delegate, presentationContextProvider, perform(_:)), ASAccountAuthenticationModificationUpgradePasswordToStrongPasswordRequest, ASAccountAuthenticationModificationReplacePasswordWithSignInWithAppleRequest, ASAccountAuthenticationModificationViewController (changePasswordWithoutUserInteraction, prepareInterfaceToChangePassword, convertAccountToSignInWithAppleWithoutUserInteraction, prepareInterfaceToConvertAccountToSignInWithApple, cancelRequest()), ASAccountAuthenticationModificationExtensionContext (getSignInWithAppleUpgradeAuthorization, completeChangePasswordRequest, completeUpgradeToSignInWithApple, cancelRequest(withError:)), the delegate and presentation protocols ✅ ≤17 adapted: the extension (com.apple.authentication-services-account-authentication-modification-ui) of the app whose webcredentials: domains include the service runs in the app that asks. Its existing credential comes from the device's Passwords store, and the store follows: the strong password (Apple's xxxxxx-xxxxxx-xxxxxx format) replaces the old one, and the password is removed once the account uses Sign in with Apple (isim's local Sign in with Apple sheet). Tested (test_vault.py::test_account_modification)
Passkey account creation: ASAuthorizationAccountCreationProvider, ASAuthorizationAccountCreationPlatformPublicKeyCredentialRequest, ASAuthorizationAccountCreationPlatformPublicKeyCredential, ASContactIdentifier, ASContactIdentifierRequest, ASEmailIdentifier, ASPhoneNumberIdentifier, ASAuthorizationResult.passkeyAccountCreation, ASAuthorizationError .preferSignInWithApple, .deviceNotConfiguredForPasskeyCreation, .credentialImport, .credentialExport ✅ 26.0 adapted: a "Create an account" sheet with the simulated Apple Account's email (or ISIM_PHONE_NUMBER when the app asks for a phone number first) and name; Continue saves a passkey like any other. The credential and contact types have no iOS 26 availability because ASAuthorizationResult's case needs them; the provider has it. Tested (test_vault.py::test_account_creation, and absent on iOS 18)
Objective-C: the credential provider, identity store, SSO and account modification classes and protocols above, ASExtensionErrorDomain, ASCredentialIdentityStoreErrorDomain, the operation constants ✅ ≤17 adapted: Apple's Objective-C names and selectors; an Objective-C subclass of ASCredentialProviderViewController or ASAccountAuthenticationModificationViewController gets the system's calls under Apple's selectors. The account creation types are Swift-only here. Tested (HelloAuthObjC: identities saved and read back, an SSO provider, a modification controller)
Types not yet in isim (iOS 17 and earlier) ❌ ≤17 not implemented, found by the 2026-10 sweep: ASAuthorizationPublicKeyCredentialAssertion, ASAuthorizationPublicKeyCredentialAssertionRequest, ASAuthorizationPublicKeyCredentialDescriptor, ASAuthorizationPublicKeyCredentialParameters, ASAuthorizationPublicKeyCredentialRegistration, ASAuthorizationPublicKeyCredentialResidentKeyPreference, ASAuthorizationResult, ASAuthorizationSecurityKeyPublicKeyCredentialAssertion, ASAuthorizationSecurityKeyPublicKeyCredentialAssertionRequest, ASAuthorizationSecurityKeyPublicKeyCredentialDescriptor, ASAuthorizationSecurityKeyPublicKeyCredentialDescriptor.Transport, ASAuthorizationSecurityKeyPublicKeyCredentialProvider, ASAuthorizationSecurityKeyPublicKeyCredentialRegistration, ASAuthorizationSecurityKeyPublicKeyCredentialRegistrationRequest, ASAuthorizationWebBrowserPlatformPublicKeyCredentialAssertionRequest, ASAuthorizationWebBrowserPlatformPublicKeyCredentialProvider, ASAuthorizationWebBrowserPlatformPublicKeyCredentialRegistrationRequest, ASAuthorizationWebBrowserPublicKeyCredentialManager, ASAuthorizationWebBrowserSecurityKeyPublicKeyCredentialAssertionRequest, ASAuthorizationWebBrowserSecurityKeyPublicKeyCredentialProvider, ASAuthorizationWebBrowserSecurityKeyPublicKeyCredentialRegistrationRequest, ASCOSEAlgorithmIdentifier, ASCOSEEllipticCurveIdentifier, ASPublicKeyCredential, ASPublicKeyCredentialClientData, ASPublicKeyCredentialClientDataCrossOriginValue, ASUserAgeRange, AuthorizationController (28 types; with their members under "Not yet in isim")
Types not yet in isim (iOS 26) ❌ 26.0 not implemented, found by the 2026-10 sweep: ASAutoFillURLScope, ASCredentialDataManager, ASCredentialExportManager, ASCredentialImportManager, ASCredentialUpdater, ASGeneratedPassword, ASGeneratePasswordsRequest, ASImportableCredentialScope, ASImportableEditableField, ASImportableExtension, ASImportableFIDO2Extensions, ASImportableFIDO2HMACCredential, ASImportableFIDO2LargeBlob, ASSavePasswordRequest, CredentialDataManager (15 types; with their members under "Not yet in isim")
Types not yet in isim (iOS 27) ❌ 27.0 not implemented, found by the 2026-10 sweep: ASDeliveredVerificationCodesManager, ASVerificationCode, DeliveredVerificationCodesManager (3 types; with their members under "Not yet in isim")

Not yet in isim

481 symbols Apple documents for iOS that isim does not have (exact; Apple snapshot 2026-10-14). Each links to Apple's documentation.

List