Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support native touchid devices #207

Open
Firstyear opened this issue Oct 6, 2022 · 10 comments
Open

Support native touchid devices #207

Firstyear opened this issue Oct 6, 2022 · 10 comments
Assignees

Comments

@Firstyear
Copy link
Member

No description provided.

@Firstyear
Copy link
Member Author

@micolous It sounds like @ericmarkmartin is keen to have a look at this, and it seems to overlap/be similar to your work with the windows apis.

@micolous
Copy link
Collaborator

micolous commented Oct 7, 2022

Cool! I've not looked into it a huge amount, so I'll hold off for now.

Here is a good starting point:

I think what'd need to happen is pretty similar to what I did with the Windows stuff -- map all the webauthn-authenticator-rs types onto Apple's types, and call it through some ObjC FFI.

@ericmarkmartin
Copy link
Collaborator

ericmarkmartin commented Oct 7, 2022

Do we have strong feelings about using an Objc FFI over Swift bindings?

Afaik, the rust-objc and swift-bridge crates are the standard for objc and swift bindings in rust respectively.

@Firstyear
Copy link
Member Author

@ericmarkmartin given the way apple is trending, swift might be the safer choice to use here, unless there is a compelling reason to go with obj-c?

@ericmarkmartin
Copy link
Collaborator

The only thing I can think of is that the rust objc binding foo might be more mature but I actually don't know enough to claim that for certain.

@micolous
Copy link
Collaborator

micolous commented Oct 8, 2022

I don't have strong feelings either way – I hadn't looked into it a whole lot yet.

@Firstyear
Copy link
Member Author

@ericmarkmartin Yeah, I think it'll be a case of investigating the two options and deciding :)

@ericmarkmartin
Copy link
Collaborator

@madsmtm has finished some work on icrate so there's now a usable ASAuthorizationServices module! I'm getting started on using this as the layer to interface with macos.

@yaleman
Copy link
Member

yaleman commented Dec 25, 2022

I wouldn't use objC, it's the "legacy" option as far as Apple's concerned.

@ericmarkmartin
Copy link
Collaborator

ericmarkmartin commented Dec 26, 2022

I don't think we have much of an option. Support for interacting with swift from rust is quite limited. Afaik there's the swift-rs and swift-bridge.

I think using the former would require us to write a lot of swift so we can expose the ASAuthorizationServices API with functions with @_cdecl annotations. The latter has the same problem, plus it's unclear how to use it to deal with a lot of common swift patterns, for example accessing vars.

I also don't think we're likely to run into an issue with Apple deprecating Objective C in some way. For newer APIs, all they're doing is writing the swift such that it's exposed to the objc runtime, and this is sufficiently low cost that I imagine they'll keep doing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants