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

SDK Support For Mac Catalyst #40

Open
igalfsg opened this issue Mar 13, 2023 · 11 comments
Open

SDK Support For Mac Catalyst #40

igalfsg opened this issue Mar 13, 2023 · 11 comments
Labels
awaiting yubico action When we've got the ball enhancement New feature or request

Comments

@igalfsg
Copy link

igalfsg commented Mar 13, 2023

Hi,

Is there a compatibility reason that Mac Catalyst is not supported? or is this something that could be enabled on my side? dotnet/maui#13855

Thanks,
Igal

@GregDomzalski
Copy link
Contributor

Hey @igalfsg . That's strange... So based on the exception you listed in the other thread, it looks like RuntimeInformation.IsOSPlatform(OSPlatform.OSX) returns false on Mac Catalyst systems.

I don't see any other options on that particular API to discover the system.

There is the System.OperatingSystem class... but that is only available in .NET 5+. Unfortunately we have to target .NET Standard 2.0 since many of our customers still use .NET Framework 4.x

I'll have to investigate this further to see what our options are.

Can you please confirm that RuntimeInformation.IsOSPlatform(OSPlatform.OSX) returns false?

Can you also please list what RuntimeInformation.OSDescription returns? Perhaps we can utilize that.

Hopefully it's a matter of adding an extra if branch here. But if PCSC is not accessible on Catalyst, then I'm afraid this will be a more substantial feature request.

@igalfsg
Copy link
Author

igalfsg commented Mar 14, 2023

Hi Greg,

Thanks for looking into it, as you predicted, the RuntimeInformation.IsOSPlatform(OSPlatform.OSX) returns false, running it on my intel laptop I got the following for RuntimeInformation.OSDescription
Darwin 22.3.0 Darwin Kernel Version 22.3.0: Mon Jan 30 20:42:11 PST 2023; root:xnu-8792.81.3~2/RELEASE_X86_64

Also for completeness of the test (even if this is not possible in earlier versions) I ran

var test = System.OperatingSystem.IsMacOS(); //returned false
var test1 = System.OperatingSystem.IsMacCatalyst();//returned true

@GregDomzalski GregDomzalski added the enhancement New feature or request label Apr 3, 2023
@Kormyr
Copy link

Kormyr commented Sep 20, 2023

Hello @GregDomzalski ,

Any update on this?
Is there another issue preventing to do something like this?

public static SdkPlatform OperatingSystem
    {
      get
      {
        if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
          return SdkPlatform.Windows;
        if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) || RuntimeInformation.IsOSPlatform(OSPlatform.Create("MACCATALYST")))
          return SdkPlatform.MacOS;
        return RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ? SdkPlatform.Linux : SdkPlatform.Unknown;
      }
    }

@GregDomzalski
Copy link
Contributor

My understanding was that MacCatalyst was also a new API set (i.e. not IOKit).

Is that not the case? If this is as simple as updating the OS check as you've described, I'm happy to make this change.

Are Catalyst apps allowed to access things like IOKit and pcsc-lite?

@Kormyr
Copy link

Kormyr commented Sep 20, 2023

Thank you for the fast answer.
The OS check is the first roadblock, and I was just wondering if some testing was done in the meantime on this topic.

@DennisDyallo
Copy link
Collaborator

Hi @Kormyr !

I have been assigned to maintain this repo. Although we're currently strapped for time and focusing on other areas, it would be interesting to see how your suggested fixes would impact the SDK.

Are you able to try this out and report your findings?

@DennisDyallo DennisDyallo added the awaiting reply When we are waiting for response from user label Jun 17, 2024
@Kormyr
Copy link

Kormyr commented Jun 18, 2024

Hello @DennisDyallo
I am glad to see that this SDK has some activity again.
I put this issue aside and don't have a Mac to test it anymore.
If you have one, it can be really easy to test this change and see if it fails somewhere else.

@DennisDyallo
Copy link
Collaborator

As I'm not that familiar with the Mac ecosystem. Can you share some of the added value we'd gain from supporting Mac Catalyst as well?

Also note that Yubico has SDK's in Objective-c and Swift as well

@Kormyr @igalfsg

@igalfsg
Copy link
Author

igalfsg commented Jun 19, 2024

Hi Dennis,

This task was created so we could support MacCatalyst which would allow onboarding from Mac's and iPads in EZCMS our application for YubiKey onboarding. Since then we have moved on to creating native applications for each.

@Kormyr
Copy link

Kormyr commented Jun 19, 2024

As I'm not that familiar with the Mac ecosystem. Can you share some of the added value we'd gain from supporting Mac Catalyst as well?

Also note that Yubico has SDK's in Objective-c and Swift as well

@Kormyr @igalfsg

We created an app using .NET MAUI and expected it to be compatible with Windows and Mac.
Because of this Yubikey SDK issue, we don't support Mac right now.

The added value of supporting MacCatalyst would be to prevent other enterprise customers like us losing time.

The very first sentence of this project is:

This is a cross-platform, all encompassing SDK for the YubiKey aimed at large to mid-sized enterprise customers.

@GregDomzalski
Copy link
Contributor

(Disclaimer: I am no longer the maintainer of this repo nor am employed by Yubico. Don't worry - all on good terms 😄)

@DennisDyallo just as FYI - It looks like most of the macOS IOKit APIs that the SDK uses are available in the Catalyst environment. Of course, figuring out the correct entitlements and then documenting things is a bit of a to-do. The bigger question mark in my mind is whether PC/SC-lite (i.e. smart card) can work as-is or if there's something bigger that needs to be done. There's always CryptoTokenKit... but that's adding an entirely new back-end for smart card.

Once I get a Mac environment set up again, I'd be happy to take a look at this. I just don't know when exactly that might be.

@DennisDyallo DennisDyallo added awaiting yubico action When we've got the ball and removed awaiting reply When we are waiting for response from user labels Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting yubico action When we've got the ball enhancement New feature or request
Development

No branches or pull requests

4 participants