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

Keychain errors when sideloading #50

Open
Wamy-Dev opened this issue Jun 14, 2024 · 13 comments
Open

Keychain errors when sideloading #50

Wamy-Dev opened this issue Jun 14, 2024 · 13 comments
Assignees
Labels
Bug Something isn't working

Comments

@Wamy-Dev
Copy link

Failed to load token: KeychainKit.Keychain.SecError(status: -34018)

The above is the error I am seeing in the logs. I can add the credentials just fine, but whenever I close the app and reopen it, the credentials go blank. Obviously we want to keep the credentials on the device so that the user can come back without having to add them often.

To Reproduce
Steps to reproduce the behavior:

  1. Install latest version
  2. Add portainer instance using URL and ptr key.
  3. Close app, remove from history
  4. Open app

Expected behavior
To be able to connect properly even when opening the app again.

@rrroyal
Copy link
Owner

rrroyal commented Jun 14, 2024

Which method of distribution are you using? App Store, TestFlight, sideloaded (.ipa/.app) or self-built?
SecError -34018 corresponds to errSecMissingEntitlement, so I'm not sure what could be the cause of it except for wrong codesigning :/

@Wamy-Dev
Copy link
Author

Which method of distribution are you using?

Sideloaded through Altstore, with all extensions. I have a developer account.

@rrroyal
Copy link
Owner

rrroyal commented Jun 14, 2024

Yeah, that could be the issue - I'm guessing the keychain-access-groups entitlement gets lost somewhere, which means that Harbour can't read/write to the Keychain.

Can you try sideloading with SideStore or Sideloadly?

@Wamy-Dev
Copy link
Author

Ill try it with SideStore, but regardless, why can't we store this locally rather than on the keychain. I would prefer to use AltStore, since I already have all of my apps there.

@Wamy-Dev
Copy link
Author

Same issue with SideStore. Seems like sideloading in general is broken. Testflight works fine though.

@rrroyal
Copy link
Owner

rrroyal commented Jun 14, 2024

Harbour is using the Keychain as it's the preferred method of storing secrets on Apple devices + it syncs between platforms.

Every app has access to it's own container (or a group container, when it needs to share contents between various targets, for example app <-> widgets). Harbour is using the latter, which needs to specify the id of the container (Shared/Extensions/KeychainKit/Keychain+.swift) and have the appropriate entitlement - keychain-access-groups.

Can you check what's the application identifier of sideloaded Harbour and whether it has App Groups capability enabled? You can check it on the Apple Developer website.

@Wamy-Dev
Copy link
Author

Sorry for the delay, it does have the App Groups capability.

@rrroyal
Copy link
Owner

rrroyal commented Jun 19, 2024

can you replace the MainBundleIdentifier to your Bundle ID in both Info.plist files (Harbour/Info.plist, PlugIns/HarbourWidgets.appex/Info.plist) and see if that fixes things?

@rrroyal rrroyal added the Help wanted Extra attention is needed label Jun 19, 2024
@rrroyal rrroyal changed the title Latest version fails to save portainer url and key Keychain errors when sideloading Jun 19, 2024
@Wamy-Dev
Copy link
Author

Sorry, I don't actually know how to do that :/

@rrroyal
Copy link
Owner

rrroyal commented Jun 20, 2024

Can you provide me Your Bundle ID then? I'll send you the (possibly) fixed build

@Wamy-Dev
Copy link
Author

Can you provide me Your Bundle ID then? I'll send you the (possibly) fixed build

xyz.shameful.Harbour.3VTF3L32BZ (explicit)

Let's hope this works!

@rrroyal
Copy link
Owner

rrroyal commented Jun 20, 2024

Replicated - unfortunately, just swapping the value in .plist files won't fix it. I'll see what I can do!

@rrroyal rrroyal added Bug Something isn't working and removed Help wanted Extra attention is needed labels Jun 20, 2024
@rrroyal rrroyal self-assigned this Jun 20, 2024
@Wamy-Dev
Copy link
Author

I ended up buying the app to support the project, but I am still willing to test any fixes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants