Skip to content

hansemannn/titanium-passkeys

Repository files navigation

Titanium iOS 16+ PassKeys

Use the iOS 16+ PassKeys APIs in Titanium!

Requirements

  • Xcode 14+ and iOS 16+
  • A server to generate the challenge used to authenticate
  • Read this document to understand when and how to use pass keys along with your other tech stack
  • Proper AASA setup for your domain, e.g.:
{
  "webcredentials": {
    "apps": [ "A1B2C3D4E5.com.example.app" ]
  }
}

Example

import PassKeys from 'ti.passkeys';

PassKeys.addEventListener('complete', event => {
  console.warn(event);

  if (event.type === 'registration') {
    // handle registration
  } else {
    // handle assertion
  }
});

PassKeys.addEventListener('error', event => {
  console.error(event.error);
});

PassKeys.performAutoFillAssistedRequests({
  challenge: 'YOUR_SERVER_CHALLENGE',
  relyingPartyIdentifier: 'example.com' // should match your ASSA setup
});

Author

Hans Knöchel

License

MIT