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

[feat] Code Signing macOS Application in development mode #7930

Open
wyhaya opened this issue Oct 1, 2023 · 5 comments
Open

[feat] Code Signing macOS Application in development mode #7930

wyhaya opened this issue Oct 1, 2023 · 5 comments

Comments

@wyhaya
Copy link

wyhaya commented Oct 1, 2023

Describe the problem

In development mode, Tauri does not code-sign macOS app. If your app needs to call some API that require permission control, you will need to re-authorize each time.

Example:

preview

If your application saves 100 passwords in the keychain, every time you run tauri dev, macOS will think it is a new unauthorized app, so you will have to enter the password 100 times in this dialog, which greatly affects the development experience.


Code signing in development mode will especially make sense if your app needs to access any of the ones listed below.

2

Describe the solution you'd like

When run tauri dev, check the environment variables listed here: Code Signing macOS Applications.
If configured, sign the app.

Alternatives considered

No response

Additional context

No response

@thewh1teagle
Copy link
Contributor

thewh1teagle commented Jan 24, 2024

@wyhaya
Can you tell what's the solution? Or even a workaround?
Should I sign the app with self signed cert everytime it reloads?
Is there a simple solution it will work with cargo tauri dev?

@thewh1teagle
Copy link
Contributor

thewh1teagle commented Jan 24, 2024

After many many solutions I tried including AID repair to the disk, and playing with different options in keychain I found something that worked and stopped this password prompt without errors:

  1. Open keychain app from launchpad
  2. Find the key (probably with the name of your app) in Login / Local Items
  3. Right click on it and choose copy
  4. Navigate to system keys, right click and paste the key
  5. Delete the key from login
  6. Double click the key in system
  7. Switch to access control and choose 'Allow all applications to access this key'
  8. Save changes
  9. Restart the app and no more password prompts.

TLDR: open keychain and copy your app key name from login / local items into system by right click the key, change tab, and paste. and then delete the old key from login tab. search term: webcrypto

@rtmotiondev
Copy link

@thewh1teagle Unfortunately that doesn't seem to work for me.

@thewh1teagle
Copy link
Contributor

Unfortunately that doesn't seem to work for me.

Double check it... I encountered the same issue again and that fixed it. macOS m1 14.5

@RandomEngy
Copy link

I copied the keys to System and they didn't show up at first. It required a restart and I could see them. I changed to "Allow all applications to access this key", but it did not appear that my app could see them, and it created new entries in the login keychain.

I tried changing the existing keys in the login keychain to "Allow all applications" but that didn't work either: it still opened the prompt. On m2 15.1.1.

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

No branches or pull requests

4 participants