Yubico / yubikit-ios

Yubico Mobile iOS SDK - YubiKit
Apache License 2.0
198 stars 44 forks source link

Make Compatible with App Extensions #42

Closed mmcguill closed 3 years ago

mmcguill commented 4 years ago

It would be very useful to include this library in App Extensions (my use case in particular is Password AutoFill extensions).

Currently if you try to build this library in an App Extension context you will get build errors related to the use of NFC (NFC access is not available to App Extensions).

A concrete example looks like this:

image

While there may be no possibility of using a YubiKey over NFC in an App Extension (Password Auto Fill mode), it should in theory be possible to use the new 5Ci over Lightning in this context, so it would be great if this library would compile that functionality while excluding the NFC functionality when built as an App Extension.

Thanks!

jensutbult commented 4 years ago

At the moment I think the only solution is for you to fork the SDK and remove all references to NFC and parts of UIKit not supported by an Autofill Credential Provider extension. The forked SDK will be used in your extension and our SDK for the normal app. In the future we might build a specific SDK for use in an extension but this is not planned for now.

mmcguill commented 4 years ago

OK, thanks for the response. It's a less than ideal situation obviously :(

imakhalova commented 4 years ago

My guess that App Extension will not support communication with External Accessory framework. Even if you remove NFC support out of SDK. For quick test you could actually take old version of SDK which didn't support NFC (2.0.1) and check whether you can detect device connection and exchange any data with device. At least you will know whether it worth your efforts in forking of this repo.

mmcguill commented 4 years ago

Thanks @imakhalova - There's no indication in the documentation that it won't work in App Extension context but of course worth a test. I've not been able to find anything online about this working either.

strongbox-mark commented 3 years ago

Hi there, has there been a decision made on support for App Extensions?

A lot of iOS users would like to use their YubiKeys in AutoFill mode.

Thanks, -Mark

jensutbult commented 3 years ago

As of now we're focusing on wrapping up the 4.0 release of the SDK and adding PIV support. Once that is done we will prioritise the next set of features to implement. We will bring this issue into that process. In the meantime I would suggest simply forking the SDK and hacking away removing the parts not supported by the App Extension. It's probably not more than a few hours of boring work but it will solve your issue and if it works will be valuable feedback for us when we decide on the next features to implement in the SDK.

strongbox-mark commented 3 years ago

I'm afraid that's not something I think I want to take on...

Shouldn't we keep this issue open? Your call totally of course.

Also, is there anyone you could ping about https://github.com/Yubico/yubikey-personalization/issues/173 ?